-
Notifications
You must be signed in to change notification settings - Fork 830
Closed
Description
Consider the following code and AST:
[<Measure>] type herth = / second
// Same AST
[<Measure>] type herth = 1 / secondAST:
Types
([SynTypeDefn
(SynComponentInfo
([{ Attributes = [ ... ], None, [], [herth],
PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector),
false, None, tmp.fsx (1,17--1,22)),
Simple
(TypeAbbrev
(Ok,
Tuple
(false,
[(true,
StaticConstant (Int32 1, tmp.fsx (1,25--1,33)));
(false,
LongIdent (SynLongIdent ([second], [], [None])))], ...]
Types
([SynTypeDefn
(SynComponentInfo
([{ Attributes = [ ... ]
Range = tmp.fsx (3,0--3,11) }], None, [], [herth],
PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector),
false, None, tmp.fsx (3,17--3,22)),
Simple
(TypeAbbrev
(Ok,
Tuple
(false,
[(true,
StaticConstant (Int32 1, tmp.fsx (3,25--3,26)));
(false,
LongIdent (SynLongIdent ([second], [], [None])))],... ], tmp.fsx (3,0--3,35))Expected behaviour
The AST should be different, there is no actual 1 in / second.
Actual behaviour
I noticed a shortcut in:
Lines 5253 to 5255 in 4be3bb5
| | INFIX_STAR_DIV_MOD_OP tupleOrQuotTypeElements | |
| { if $1 <> "/" then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnexpectedInfixOperator()); | |
| SynType.Tuple(false, (true, SynType.StaticConstant (SynConst.Int32 1, lhs parseState)) :: $2, lhs parseState) } |
Perhaps we need a new case for this in SynType.
I'm not quite sure if SynType.Tuple is quite correct to capture a / b in the first place.
How should this be modelled? Any Ideas @dsyme and @auduchinok?
//cc @edgarfgp
edgarfgp and adelarsqadelarsq
Metadata
Metadata
Assignees
Type
Projects
Status
Done