Skip to content

[Bug] Rescript 10.1.0-alpha.2 allows an empty record (?) {} where a tuple is expected #5728

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
3 of 5 tasks
jbhoot opened this issue Oct 11, 2022 · 3 comments
Closed
3 of 5 tasks

Comments

@jbhoot
Copy link

jbhoot commented Oct 11, 2022

ReScript playground set to use ReScript v10.0.1 rightly raises an error for the following code snippet:

https://rescript-lang.org/try?code=C4TwDgpgBAhgxsAlgewHYChSShAZriBTcaAE0QGcwZg4ALKAXlgRVSYD4oBXVRYdBAAewCACdUMADZQA7vzoAFGCCnIYpAFxQAFHvJUa9ADRQA5NVXrSASk48+wUxZVqNNu4y54CCJlAAiAFJEUghUJFAA9CkIYCghf3lgJVdrHQBvAF8bdCA

However, v10.1.0-alpha.2 compiles with the above error, even producing a JS output. Minimal repro repo: https://github.com/jayeshbhoot/rescript-empty-record-bug

Thank you for filing! Check list:

  • Is it a bug? Usage questions should often be asked in the forum instead.
  • Concise, focused, friendly issue title & description.
  • A minimal, reproducible example.
  • OS and browser versions, if relevant.
  • Is it already fixed in master?
@cristianoc
Copy link
Collaborator

cristianoc commented Oct 11, 2022

Is using an external necessary to reproduce the issue?

cristianoc added a commit that referenced this issue Oct 11, 2022
@cristianoc
Copy link
Collaborator

Good catch.
Simple repro:

let foo = x => x+1
let x = foo({})

cristianoc added a commit that referenced this issue Oct 11, 2022
@jbhoot
Copy link
Author

jbhoot commented Oct 12, 2022

Sorry I checked the notifications only just now.

Glad to see you figured it out. Thank you for the quick fix.

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