Commit fe60fcb
authored
Workaround for
* Workaround for `@as`in labels in uncurried externals.
Examples like this:
```
@obj
external makeOptions: (
~objectMode: @as(json`false`) _,
~name: string,
unit,
) => int = ""
```
change the arity of the function.
The arity of uncurried functions is determined at parsing type.
This means that this peculiarity of externals affects parsing.
This PR gives an approximate workaround based on the labelled arg having `@as`, and the type being `_` (the any type).
Fixes #6517
* Example with 2 default args.
* Add example outside externals, which should not fail.
* Restrict workaround to only fire inside an external.@asin labels in uncurried externals. (#6527)1 parent 8031c13 commit fe60fcb
File tree
5 files changed
+68
-1
lines changed- jscomp
- syntax/src
- test
5 files changed
+68
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
154 | 158 | | |
155 | 159 | | |
156 | 160 | | |
| |||
4276 | 4280 | | |
4277 | 4281 | | |
4278 | 4282 | | |
| 4283 | + | |
| 4284 | + | |
| 4285 | + | |
| 4286 | + | |
| 4287 | + | |
| 4288 | + | |
| 4289 | + | |
| 4290 | + | |
| 4291 | + | |
| 4292 | + | |
| 4293 | + | |
| 4294 | + | |
| 4295 | + | |
| 4296 | + | |
| 4297 | + | |
| 4298 | + | |
4279 | 4299 | | |
4280 | 4300 | | |
4281 | 4301 | | |
| |||
5441 | 5461 | | |
5442 | 5462 | | |
5443 | 5463 | | |
| 5464 | + | |
| 5465 | + | |
5444 | 5466 | | |
5445 | 5467 | | |
5446 | 5468 | | |
| |||
5465 | 5487 | | |
5466 | 5488 | | |
5467 | 5489 | | |
| 5490 | + | |
5468 | 5491 | | |
5469 | 5492 | | |
5470 | 5493 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
Large diffs are not rendered by default.
0 commit comments