Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3d8ca49

Browse files
shulhicknitt
authored andcommitted
Fix tuple coercion (#7024)
* Fix tuple coercionIt was only handled for the first arg in the tuple* Update CHANGELOG
1 parent49e702f commit3d8ca49

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Disallow spreading anything but regular variants inside of other variants.https://github.com/rescript-lang/rescript-compiler/pull/6980
1919
- Fix comment removed when function signature has`type` keyword.https://github.com/rescript-lang/rescript-compiler/pull/6997
2020
- Fix parse error on doc comment before "and" in type def.https://github.com/rescript-lang/rescript-compiler/pull/7001
21+
- Fix tuple coercion.https://github.com/rescript-lang/rescript-compiler/pull/7024
2122

2223
#11.1.3
2324

‎jscomp/syntax/src/res_core.ml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,6 +1865,7 @@ and parseConstrainedExprRegion p =
18651865
|tokenwhenGrammar.isExprStart token -> (
18661866
let expr= parseExpr pin
18671867
match p.Parser.tokenwith
1868+
|ColonGreaterThan ->Some (parseCoercedExpr~expr p)
18681869
|Colon ->
18691870
Parser.next p;
18701871
let typ= parseTypExpr pin
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
letfoo= (x:int)=> (x :>int)
22

3-
letfoo=x=> (x :t :>int)
3+
letfoo=x=> (x :t :>int)
4+
5+
let_= (x :int)
6+
7+
letfoo= (x :int,y :>float)
8+
9+
letfoo= (x :int,y :>float,z :>int)
10+
11+
letfoo= (x :int,y,z :>int)
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
let foo (x : int) = (x :> int)
2-
let foo x = ((x : t) :> int)
2+
let foo x = ((x : t) :> int)
3+
let _ = (x : int)
4+
let foo = ((x : int), (y :> float))
5+
let foo = ((x : int), (y :> float), (z :> int))
6+
let foo = ((x : int), y, (z :> int))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp