rescript-compiler
rescript-compiler copied to clipboard
The compiler for ReScript.
Labeled optional arguments are handled differently in general functions and functions annotated with `@react.component`. [Playground](https://rescript-lang.org/try?version=v11.0.1&code=DYUwLgBAZgdhC8EAUA-AHgLggewA5gEtsYAeAZzACcCYBzAPngGVsBbEJAIim204Ep+CegCgIEMgHcCYAMYALCGggBvMRAA+EFuyRoh8ekoC09AEogAhrLAA6CtTrqtAOWIhhEC9bswArsDA6gC+IiKwqGjMbBycAEaWlAL8pgDCxGTYoLbA2LThMJHwbjAgKfTpMJnZufkR5ZXVIDl5YazYACYBHmapAIwIquoAApRWNraybLjuMGDqoJCslgDWHoiRWHiExORUNAwGouLiUjIKSkMnmtoxekcm5uN2Dgfq4q7unt4T-oHvEFCoRE7S6oC8qQATIM1OJRs9JtNZvNxIsIMs1oNNjh8ERSK86IxuLxOBAAPQAKggMgk8mwAQ6EDiHh0sR4fCEFLJRwBaFMPxe+ycwJIvQGURUrK4CSS-GC5PoaQyWWatREov6SngKhKIHlZMVFWVNVa6t60Ki8USpINSqqKpa+Q1Fu1uv1hsaDrVQA) ```rescript let fn = (~x: option=Some("foo")) => switch x { | Some(x) => x->React.string |...
Follow-up to #6952 where @glennsl wrote: > ... In OCaml, an empty variant type would be `type a = |`. That doesn't seem to be supported in Rescript though. Do...
```res let v = 1e ``` emits ```js var v = 1e; export { v , } ``` which is invalid in JS.
#6663 fixed an issue where `@module("..") external ..` would also emit a static import. But it looks like `external` + dynamic import isn't very well supported if the `external` is...
```res // ABC.resi type a = X | Y0 ``` ```res // ABC.res type a = X | Y ``` The compiler failed to compile and show the message as...
## Background Imagine a class statement written from external JS. ```js // rescript_error.mjs export class RescriptError extends Error { constructor(exnId, payload) { super(); } } // and in rescript_error.cjs module.exports...
Resolves #5779 This PR contains many breaking changes Completely dropped - [x] BukleScript compile time contexts - OCaml utils - [ ] parser - [ ] lexer - [ ]...