All codes › Parse
KEXEP-0010
error ExpectedTypeName
[KEXEP-0010]: Error, expected type name, got found
Type names start with a capital letter. shape is lowercase, so the parser does not read it as a type name.
type shape = Circle(Float) | Square(Float)
example.kex:1:6: [KEXEP-0010]: Error, expected type name, got LowerIdent [shape]
|
1 | type shape = Circle(Float) | Square(Float)
| ^^^^^
Fixing it
type Shape = Circle(Float) | Square(Float)
main do
IO.printLine(Circle(1.0))
end
Is this diagnostic reported where it should not be, missing where it should be, or saying the wrong thing? Report it on the compiler's issue tracker.