Closed externl closed 1 year ago
In the original message, we have:
error E011: invalid enum 'MyEnum': underlying type 'None' is not supported for enums
None is a Rust type, but is not a Slice type, I think this needs fixing too
error E0XX: invalid enum 'MyEnum': Slice2 enums must have an underlying type. e.g. 'enum Bar : uint8'
and remvoe the Note
I'm not fond of these notes:
= note: file is using the Slice2 encoding by default = note: to use a different encoding, specify it at the top of the slice file. e.g. 'encoding = Slice1
It is like we suggest going back to Slice1 at every opportunity
I think we should suggest "you may want to use Slice1" only when:
- the user defines a class in a Slice2 file
- the user references a Slice1-only construct from a Slice2 file (class or other constructed type that is Slice1-only for some reason)
Yes, I've opened a new issue to fix this generally. I'll fix the enum for now.
I don't think we should mix the error message and suggestion together. I agree that we should not use none.
error [E011]: invalid enum 'Bar': an underlying type is required
--> foo.slice:3:1
|
3 | enum Bar {
| --------
|
= note: Slice2 enums must have an underlying type. e.g. 'enum Bar : uint8'
Failed: Compilation failed with 1 error(s)
Closes #569