Skip to content

Exotic "TAG" field in inline records results in unexpected behavior #5269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
amiralies opened this issue Sep 1, 2021 · 1 comment
Closed

Comments

@amiralies
Copy link
Contributor

type t = Admin({id: string, \"TAG": int}) | Member({id: string, age: int})

let admin = Admin({id: "0", \"TAG": 231})

let isAdmin = user =>
  switch user {
  | Admin(_) => true
  | Member(_) => false
  }

Js.log(isAdmin(admin)) // false

@bobzhang
Copy link
Member

bobzhang commented Sep 2, 2021

Hi @amiralies \"" is not a feature. It is very easy to break things with it.
see this: rescript-lang/rescript-lang.org#242

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants