-
Notifications
You must be signed in to change notification settings - Fork 803
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parser: recover on missing union case field types (#17455)
* Parser: recover on missing union case field types * Release notes
- Loading branch information
1 parent
d2d38e3
commit d8e2f21
Showing
8 changed files
with
148 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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 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 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,4 @@ | ||
module Module | ||
|
||
type U = | ||
| A of i: int |
35 changes: 35 additions & 0 deletions
35
tests/service/data/SyntaxTree/Type/Union - Field 01.fs.bsl
This file contains 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,35 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/Type/Union - Field 01.fs", false, QualifiedNameOfFile Module, [], | ||
[], | ||
[SynModuleOrNamespace | ||
([Module], false, NamedModule, | ||
[Types | ||
([SynTypeDefn | ||
(SynComponentInfo | ||
([], None, [], [U], | ||
PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), | ||
false, None, (3,5--3,6)), | ||
Simple | ||
(Union | ||
(None, | ||
[SynUnionCase | ||
([], SynIdent (A, None), | ||
Fields | ||
[SynField | ||
([], false, Some i, | ||
LongIdent (SynLongIdent ([int], [], [None])), | ||
false, | ||
PreXmlDoc ((4,11), FSharp.Compiler.Xml.XmlDocCollector), | ||
None, (4,11--4,17), { LeadingKeyword = None | ||
MutableKeyword = None })], | ||
PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), | ||
None, (4,6--4,17), { BarRange = Some (4,4--4,5) })], | ||
(4,4--4,17)), (4,4--4,17)), [], None, (3,5--4,17), | ||
{ LeadingKeyword = Type (3,0--3,4) | ||
EqualsRange = Some (3,7--3,8) | ||
WithKeyword = None })], (3,0--4,17))], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--4,17), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) |
This file contains 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,4 @@ | ||
module Module | ||
|
||
type U = | ||
| A of i: |
36 changes: 36 additions & 0 deletions
36
tests/service/data/SyntaxTree/Type/Union - Field 02.fs.bsl
This file contains 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,36 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/Type/Union - Field 02.fs", false, QualifiedNameOfFile Module, [], | ||
[], | ||
[SynModuleOrNamespace | ||
([Module], false, NamedModule, | ||
[Types | ||
([SynTypeDefn | ||
(SynComponentInfo | ||
([], None, [], [U], | ||
PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), | ||
false, None, (3,5--3,6)), | ||
Simple | ||
(Union | ||
(None, | ||
[SynUnionCase | ||
([], SynIdent (A, None), | ||
Fields | ||
[SynField | ||
([], false, Some i, FromParseError (4,13--4,13), | ||
false, | ||
PreXmlDoc ((4,11), FSharp.Compiler.Xml.XmlDocCollector), | ||
None, (4,11--4,13), { LeadingKeyword = None | ||
MutableKeyword = None })], | ||
PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), | ||
None, (4,6--4,13), { BarRange = Some (4,4--4,5) })], | ||
(4,4--4,13)), (4,4--4,13)), [], None, (3,5--4,13), | ||
{ LeadingKeyword = Type (3,0--3,4) | ||
EqualsRange = Some (3,7--3,8) | ||
WithKeyword = None })], (3,0--4,13))], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--4,13), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) | ||
|
||
(5,0)-(5,0) parse error Incomplete structured construct at or before this point in union case |
This file contains 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,4 @@ | ||
module Module | ||
|
||
type U = | ||
| A of i: * int |
43 changes: 43 additions & 0 deletions
43
tests/service/data/SyntaxTree/Type/Union - Field 03.fs.bsl
This file contains 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,43 @@ | ||
ImplFile | ||
(ParsedImplFileInput | ||
("/root/Type/Union - Field 03.fs", false, QualifiedNameOfFile Module, [], | ||
[], | ||
[SynModuleOrNamespace | ||
([Module], false, NamedModule, | ||
[Types | ||
([SynTypeDefn | ||
(SynComponentInfo | ||
([], None, [], [U], | ||
PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), | ||
false, None, (3,5--3,6)), | ||
Simple | ||
(Union | ||
(None, | ||
[SynUnionCase | ||
([], SynIdent (A, None), | ||
Fields | ||
[SynField | ||
([], false, Some i, FromParseError (4,13--4,13), | ||
false, | ||
PreXmlDoc ((4,11), FSharp.Compiler.Xml.XmlDocCollector), | ||
None, (4,11--4,13), { LeadingKeyword = None | ||
MutableKeyword = None }); | ||
SynField | ||
([], false, None, | ||
LongIdent (SynLongIdent ([int], [], [None])), | ||
false, | ||
PreXmlDoc ((4,16), FSharp.Compiler.Xml.XmlDocCollector), | ||
None, (4,16--4,19), { LeadingKeyword = None | ||
MutableKeyword = None })], | ||
PreXmlDoc ((4,4), FSharp.Compiler.Xml.XmlDocCollector), | ||
None, (4,6--4,19), { BarRange = Some (4,4--4,5) })], | ||
(4,4--4,19)), (4,4--4,19)), [], None, (3,5--4,19), | ||
{ LeadingKeyword = Type (3,0--3,4) | ||
EqualsRange = Some (3,7--3,8) | ||
WithKeyword = None })], (3,0--4,19))], | ||
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, | ||
(1,0--4,19), { LeadingKeyword = Module (1,0--1,6) })], (true, true), | ||
{ ConditionalDirectives = [] | ||
CodeComments = [] }, set [])) | ||
|
||
(4,14)-(4,15) parse error Unexpected symbol '*' in union case |