-
Notifications
You must be signed in to change notification settings - Fork 824
Allow let!
and use!
binding with type annotation without parentheses.
#18508
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
Merged
Merged
Changes from 16 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
c4b40cb
new parser production rule.
edgarfgp 0b489a1
Add let! and use! syntax tree tests
edgarfgp be13fe0
Update existing syntax tree tests
edgarfgp 4e00653
try update mkSynMemberDefnGetSet
edgarfgp b223cd4
format code
edgarfgp 7c592a8
try different parser rule
edgarfgp e3f7b8c
Add new test
edgarfgp 43e9ea2
Revert "new parser production rule."
edgarfgp b26be8b
Revert "try update mkSynMemberDefnGetSet"
edgarfgp cbe3d48
Revert "Update existing syntax tree tests"
edgarfgp acb8742
update ce let! and use! test
edgarfgp 00e687c
Merge branch 'main' into fix-10697
edgarfgp 3034ffb
more tests
edgarfgp 99cc8d4
reduce diff
edgarfgp dd416dc
release notes
edgarfgp 5eb3102
Merge branch 'main' into fix-10697
edgarfgp e54cb12
more tests
edgarfgp 9e65095
Merge branch 'main' into fix-10697
edgarfgp f7837a4
Merge branch 'main' into fix-10697
edgarfgp e608ce6
try headBindingPattern
edgarfgp 50114d1
Update tests
edgarfgp b16bbb5
more tests
edgarfgp 84ea9ba
opt_topReturnTypeWithTypeConstraints
edgarfgp 2b09352
Merge branch 'main' into fix-10697
edgarfgp 420a92d
Merge branch 'main' into fix-10697
edgarfgp afcfc17
Merge branch 'main' into fix-10697
edgarfgp 4b22d90
Merge branch 'main' into fix-10697
edgarfgp a15afa2
Merge branch 'main' into fix-10697
edgarfgp 2669c9b
Merge branch 'main' into fix-10697
edgarfgp 71788e5
Merge branch 'main' into fix-10697
edgarfgp 6b6e86f
Update SyntaxTree tests to include WarnDirectives
edgarfgp 85a3401
Add LanguageFeature
edgarfgp fda8a38
Language release notes
edgarfgp e404fa1
Update CheckLanguageFeatureAndRecover in pars.fsy
edgarfgp 05d11d8
update tests
edgarfgp 0d83611
Merge branch 'main' into fix-10697
edgarfgp 03f1ced
update release notes
edgarfgp 64d72d8
Better naming
edgarfgp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module Module | ||
|
||
async { | ||
let! res: int = async { return 1 } | ||
return res | ||
} |
38 changes: 38 additions & 0 deletions
38
tests/service/data/SyntaxTree/SynType/Typed LetBang 01.fs.bsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/SynType/Typed LetBang 01.fs", false, QualifiedNameOfFile Module, [], | ||
[], | ||
[SynModuleOrNamespace | ||
([Module], false, NamedModule, | ||
[Expr | ||
(App | ||
(NonAtomic, false, Ident async, | ||
ComputationExpr | ||
(false, | ||
LetOrUseBang | ||
(Yes (4,4--4,38), false, true, | ||
Typed | ||
(LongIdent | ||
(SynLongIdent ([res], [], [None]), None, None, | ||
Pats [], None, (4,9--4,12)), | ||
LongIdent (SynLongIdent ([int], [], [None])), | ||
(4,9--4,17)), | ||
App | ||
(NonAtomic, false, Ident async, | ||
ComputationExpr | ||
(false, | ||
YieldOrReturn | ||
((false, true), Const (Int32 1, (4,35--4,36)), | ||
(4,28--4,36), | ||
{ YieldOrReturnKeyword = (4,28--4,34) }), | ||
(4,26--4,38)), (4,20--4,38)), [], | ||
YieldOrReturn | ||
((false, true), Ident res, (5,4--5,14), | ||
{ YieldOrReturnKeyword = (5,4--5,10) }), (4,4--5,14), | ||
{ LetOrUseBangKeyword = (4,4--4,8) | ||
EqualsRange = Some (4,18--4,19) }), (3,6--6,1)), | ||
(3,0--6,1)), (3,0--6,1))], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module Module | ||
|
||
async { | ||
let! (res: int) = async { return 1 } | ||
return res | ||
} |
38 changes: 38 additions & 0 deletions
38
tests/service/data/SyntaxTree/SynType/Typed LetBang 02.fs.bsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/SynType/Typed LetBang 02.fs", false, QualifiedNameOfFile Module, [], | ||
[], | ||
[SynModuleOrNamespace | ||
([Module], false, NamedModule, | ||
[Expr | ||
(App | ||
(NonAtomic, false, Ident async, | ||
ComputationExpr | ||
(false, | ||
LetOrUseBang | ||
(Yes (4,4--4,40), false, true, | ||
Paren | ||
(Typed | ||
(Named | ||
(SynIdent (res, None), false, None, (4,10--4,13)), | ||
LongIdent (SynLongIdent ([int], [], [None])), | ||
(4,10--4,18)), (4,9--4,19)), | ||
App | ||
(NonAtomic, false, Ident async, | ||
ComputationExpr | ||
(false, | ||
YieldOrReturn | ||
((false, true), Const (Int32 1, (4,37--4,38)), | ||
(4,30--4,38), | ||
{ YieldOrReturnKeyword = (4,30--4,36) }), | ||
(4,28--4,40)), (4,22--4,40)), [], | ||
YieldOrReturn | ||
((false, true), Ident res, (5,4--5,14), | ||
{ YieldOrReturnKeyword = (5,4--5,10) }), (4,4--5,14), | ||
{ LetOrUseBangKeyword = (4,4--4,8) | ||
EqualsRange = Some (4,20--4,21) }), (3,6--6,1)), | ||
(3,0--6,1)), (3,0--6,1))], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--6,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module Module | ||
|
||
async { | ||
let (a: int, b: int) = 1, 3 | ||
let! (c: int, d: int) = async { return 1, 3 } | ||
return a + b + c + d | ||
} |
125 changes: 125 additions & 0 deletions
125
tests/service/data/SyntaxTree/SynType/Typed LetBang 03.fs.bsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/SynType/Typed LetBang 03.fs", false, QualifiedNameOfFile Module, [], | ||
[], | ||
[SynModuleOrNamespace | ||
([Module], false, NamedModule, | ||
[Expr | ||
(App | ||
(NonAtomic, false, Ident async, | ||
ComputationExpr | ||
(false, | ||
LetOrUse | ||
(false, false, | ||
[SynBinding | ||
(None, Normal, false, false, [], | ||
PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), | ||
SynValData | ||
(None, | ||
SynValInfo ([], SynArgInfo ([], false, None)), | ||
None), | ||
Paren | ||
(Tuple | ||
(false, | ||
[Typed | ||
(Named | ||
(SynIdent (a, None), false, None, | ||
(4,9--4,10)), | ||
LongIdent | ||
(SynLongIdent ([int], [], [None])), | ||
(4,9--4,15)); | ||
Typed | ||
(Named | ||
(SynIdent (b, None), false, None, | ||
(4,17--4,18)), | ||
LongIdent | ||
(SynLongIdent ([int], [], [None])), | ||
(4,17--4,23))], [(4,15--4,16)], (4,9--4,23)), | ||
(4,8--4,24)), None, | ||
Tuple | ||
(false, | ||
[Const (Int32 1, (4,27--4,28)); | ||
Const (Int32 3, (4,30--4,31))], [(4,28--4,29)], | ||
(4,27--4,31)), (4,8--4,24), Yes (4,4--4,31), | ||
{ LeadingKeyword = Let (4,4--4,7) | ||
InlineKeyword = None | ||
EqualsRange = Some (4,25--4,26) })], | ||
LetOrUseBang | ||
(Yes (5,4--5,49), false, true, | ||
Paren | ||
(Tuple | ||
(false, | ||
[Typed | ||
(Named | ||
(SynIdent (c, None), false, None, | ||
(5,10--5,11)), | ||
LongIdent (SynLongIdent ([int], [], [None])), | ||
(5,10--5,16)); | ||
Typed | ||
(Named | ||
(SynIdent (d, None), false, None, | ||
(5,18--5,19)), | ||
LongIdent (SynLongIdent ([int], [], [None])), | ||
(5,18--5,24))], [(5,16--5,17)], (5,10--5,24)), | ||
(5,9--5,25)), | ||
App | ||
(NonAtomic, false, Ident async, | ||
ComputationExpr | ||
(false, | ||
YieldOrReturn | ||
((false, true), | ||
Tuple | ||
(false, | ||
[Const (Int32 1, (5,43--5,44)); | ||
Const (Int32 3, (5,46--5,47))], | ||
[(5,44--5,45)], (5,43--5,47)), | ||
(5,36--5,47), | ||
{ YieldOrReturnKeyword = (5,36--5,42) }), | ||
(5,34--5,49)), (5,28--5,49)), [], | ||
YieldOrReturn | ||
((false, true), | ||
App | ||
(NonAtomic, false, | ||
App | ||
(NonAtomic, true, | ||
LongIdent | ||
(false, | ||
SynLongIdent | ||
([op_Addition], [], | ||
[Some (OriginalNotation "+")]), None, | ||
(6,21--6,22)), | ||
App | ||
(NonAtomic, false, | ||
App | ||
(NonAtomic, true, | ||
LongIdent | ||
(false, | ||
SynLongIdent | ||
([op_Addition], [], | ||
[Some (OriginalNotation "+")]), | ||
None, (6,17--6,18)), | ||
App | ||
(NonAtomic, false, | ||
App | ||
(NonAtomic, true, | ||
LongIdent | ||
(false, | ||
SynLongIdent | ||
([op_Addition], [], | ||
[Some | ||
(OriginalNotation "+")]), | ||
None, (6,13--6,14)), Ident a, | ||
(6,11--6,14)), Ident b, | ||
(6,11--6,16)), (6,11--6,18)), | ||
Ident c, (6,11--6,20)), (6,11--6,22)), | ||
Ident d, (6,11--6,24)), (6,4--6,24), | ||
{ YieldOrReturnKeyword = (6,4--6,10) }), | ||
(5,4--6,24), { LetOrUseBangKeyword = (5,4--5,8) | ||
EqualsRange = Some (5,26--5,27) }), | ||
(4,4--6,24), { LetOrUseKeyword = (4,4--4,7) | ||
InKeyword = None }), (3,6--7,1)), | ||
(3,0--7,1)), (3,0--7,1))], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--7,1), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module Module | ||
|
||
async { | ||
let a: int, b: int = 1, 3 | ||
let! c: int, d: int = async { return 1, 3 } | ||
return a + b + c + d | ||
} |
51 changes: 51 additions & 0 deletions
51
tests/service/data/SyntaxTree/SynType/Typed LetBang 04.fs.bsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/SynType/Typed LetBang 04.fs", false, QualifiedNameOfFile Module, [], | ||
[], | ||
[SynModuleOrNamespace | ||
([Module], false, NamedModule, | ||
[Expr | ||
(App | ||
(NonAtomic, false, Ident async, | ||
ComputationExpr | ||
(false, | ||
Tuple | ||
(false, | ||
[LetOrUse | ||
(false, false, | ||
[SynBinding | ||
(None, Normal, false, false, [], | ||
PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), | ||
SynValData | ||
(None, | ||
SynValInfo ([], SynArgInfo ([], false, None)), | ||
None), | ||
Named | ||
(SynIdent (a, None), false, None, (4,8--4,9)), | ||
Some | ||
(SynBindingReturnInfo | ||
(LongIdent | ||
(SynLongIdent ([int], [], [None])), | ||
(4,11--4,14), [], | ||
{ ColonRange = Some (4,9--4,10) })), | ||
Typed | ||
(ArbitraryAfterError | ||
("localBinding2", (4,14--4,14)), | ||
LongIdent (SynLongIdent ([int], [], [None])), | ||
(4,14--4,14)), (4,8--4,9), Yes (4,4--4,14), | ||
{ LeadingKeyword = Let (4,4--4,7) | ||
InlineKeyword = None | ||
EqualsRange = None })], | ||
ArbitraryAfterError ("declExpr3", (5,15--5,16)), | ||
(4,4--5,16), { LetOrUseKeyword = (4,4--4,7) | ||
InKeyword = None }); Ident d], | ||
[(5,15--5,16)], (4,4--5,18)), (3,6--5,47)), (3,0--5,47)), | ||
(3,0--5,47))], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--5,47), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) | ||
|
||
(4,14)-(4,15) parse error Unexpected symbol ',' in binding. Expected '=' or other token. | ||
(5,15)-(5,16) parse error Unexpected symbol ',' in expression. Expected '=' or other token. | ||
(6,4)-(6,10) parse error Incomplete structured construct at or before this point in implementation file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module Module | ||
let! x:int = async { return 1 } | ||
let! (y:int) = async { return 2 } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.