DuetHealth / Hexicon

Generate string definitions from code--like magic
MIT License
2 stars 0 forks source link

Run time errors should be visible at compile time #2

Open ThasianX opened 4 years ago

ThasianX commented 4 years ago

For LocalizableNameString, I think that's what it's called, you can use a name that doesn't exist and the compiler allows it to compile. Only at run time do you get a fatalError crash. We should implement a phantom type to resolve this and add compile time support.

rpwachowski commented 3 years ago

Instead of crashing with a fatal error, the tool should just return some sort of clearly-invalid string letting a user know that the generation script didn't actually run. Given the way the tool works, crashing is very much not expected.

Shameless plug: could integrate https://github.com/rpwachowski/runtime-issues to raise a runtime issue when this occurs.

ThasianX commented 3 years ago

true. a more descriptive error would be great. also nice lib. however, at the same time, the user has to wait until the build finishes to see that hey, the string is invalid. the best case scenario would be to have compile time checks so that as they are writing the code, they know and can fix it immediately.