distinct object
type definition crashes the compiler
#1434
Labels
Milestone
distinct object
type definition crashes the compiler
#1434
Example
Actual Output
The compiler crashes:
Expected Output
A proper compiler error about
distinct object
not being a valid type.Additional Information
The crash is due to the
object
part resulting in an incompletetyObject
type instance. Among other things, it's missing a symbol, violating the invariant oftyObject
always having a symbol attached, thus crashing the compiler once the symbol is attempted to be accessed.There are two problems here:
object
as it's used here doesn't construct atyObject
type, but instead names the built-inobject
type-class (i.e.,(BuiltInTypeClass (Object))
). The logic insemtypes.semObjectNode
doesn't handle this properly.distinct T
whereT
is a type-class is only valid in a routine parameter or generic parameter position, but there's nothing enforcing this.References
The issue was discovered with the cps test suite and reported by @alaviss on Matrix.
The text was updated successfully, but these errors were encountered: