Open hcnelson99 opened 6 years ago
You can elide the tagged
as well and observed the same behavior. e.g.,
type Foo
val x: Unit
type Bar extends Foo
val x: Unit
Identical CoreWyvernIL is generated
I'm thinking about the semantics of this one. Definitely you should not be able to extend a type that includes "comprises." So this is definitely a bug.
But if a type is not tagged, maybe "extends" should be allowed, and mean that the declared type is a subtype of the parent--and perhaps also that it inherits its parents members? This would require changing the core IL, probably, to represent "extends" without tagging. Something to think about.
Low priority issue.
Test case:
Observed behavior: Clean compilation.
Expected behavior: Error because Foo isn't marked as extensible (a tagged type).
The generated CoreWyvernIL here also looks wrong:
Bar is marked as a datatype with
comprises []
implying no types should be able to extend it, but it instead should be marked asextag
(openly extensible). Wyvern doesn't seem to be checking thiscomprises
info anyways since it compiles if you add atype Baz extends Bar