rescript-compiler icon indicating copy to clipboard operation
rescript-compiler copied to clipboard

Irrelevant @tag validation for opaque types

Open DZakh opened this issue 1 year ago • 1 comments

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

DZakh avatar Feb 07 '24 09:02 DZakh

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.

cristianoc avatar Feb 07 '24 09:02 cristianoc