未验证 提交 3d5e7007 编写于 作者: E Eugene Auduchinok 提交者: GitHub

Parser: fix tree for missing item in top tuple type (#15909)

上级 d1ed6306
......@@ -663,6 +663,8 @@ module SynInfo =
let emptySynValData = SynValData(None, emptySynValInfo, None, None)
let emptySynArgInfo = SynArgInfo([], false, None)
/// Infer the syntactic information for a 'let' or 'member' definition, based on the argument pattern,
/// any declared return information (e.g. .NET attributes on the return element), and the r.h.s. expression
/// in the case of 'let' definitions.
......
......@@ -257,6 +257,8 @@ module SynInfo =
val emptySynValData: SynValData
val emptySynArgInfo: SynArgInfo
/// Infer the syntactic information for a 'let' or 'member' definition, based on the argument pattern,
/// any declared return information (e.g. .NET attributes on the return element), and the r.h.s. expression
/// in the case of 'let' definitions.
......
......@@ -5690,7 +5690,7 @@ topTupleType:
let mStar = rhs parseState 2
let ty2 = SynType.FromParseError(mStar.EndRange)
let path = [SynTupleTypeSegment.Type ty1; SynTupleTypeSegment.Star mStar; SynTupleTypeSegment.Type ty2]
mkSynTypeTuple path, [argInfo] }
mkSynTypeTuple path, [argInfo; SynInfo.emptySynArgInfo] }
| STAR topTupleTypeElements
{ let mStar = rhs parseState 1
......@@ -5713,7 +5713,7 @@ topTupleTypeElements:
{ let ty1, argInfo = $1
let mStar = rhs parseState 2
let ty2 = SynType.FromParseError(mStar.EndRange)
[(SynTupleTypeSegment.Type ty1, Some argInfo); (SynTupleTypeSegment.Star mStar, None); (SynTupleTypeSegment.Type ty2, None)] }
[SynTupleTypeSegment.Type ty1, Some argInfo; SynTupleTypeSegment.Star mStar, None; SynTupleTypeSegment.Type ty2, Some SynInfo.emptySynArgInfo] }
| STAR topTupleTypeElements
{ let mStar = rhs parseState 1
......
SigFile
(ParsedSigFileInput
("/root/ModuleMember/Val 01.fsi", QualifiedNameOfFile Module, [], [],
[SynModuleOrNamespaceSig
([Module], false, NamedModule,
[Val
(SynValSig
([], SynIdent (f, None), SynValTyparDecls (None, true),
Fun
(Tuple
(false,
[Type (LongIdent (SynLongIdent ([int], [], [None])));
Star (3,11--3,12); Type (FromParseError (3,12--3,12))],
(3,7--3,12)),
LongIdent (SynLongIdent ([unit], [], [None])), (3,7--3,20),
{ ArrowRange = (3,13--3,15) }),
SynValInfo
([[SynArgInfo ([], false, None); SynArgInfo ([], false, None)]],
SynArgInfo ([], false, None)), false, false,
PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), None,
None, (3,0--3,20), { LeadingKeyword = Val (3,0--3,3)
InlineKeyword = None
WithKeyword = None
EqualsRange = None }), (3,0--3,20))],
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None,
(1,0--3,20), { LeadingKeyword = Module (1,0--1,6) })],
{ ConditionalDirectives = []
CodeComments = [] }, set []))
(3,13)-(3,15) parse error Unexpected symbol '->' in value signature
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册