rescript-compiler
rescript-compiler copied to clipboard
Irrelevant @tag validation for opaque types
module A: {
type a
} = {
@tag("kind")
type a = Foo
}
Crashes with:
[E] Line 3, column 4:
Signature mismatch:
...
Type declarations do not match: type a = Foo is not included in type a
playground.res:2:3-8: Expected declaration
playground.res:5:3-14: Actual declaration
Their @tag annotations differ.
https://rescript-lang.org/try?version=v11.0.1&code=LYewJgrgNgpgBAQQFxwN4Cg5wC4E8AO8AhugL5wC8amcAAtkQOYAUARANYCWAdmKwJQ08hOEUpwAYiBBl0QA
The error looks fine. Having @tag around will matter as long as soon as the type definition is extended with cases with payloads, so it seems good practice to also not have it here.