From 034d4d6b8b92aa5476f85be1cb6472af78a1a4f1 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Sun, 11 May 2025 15:31:41 +0100 Subject: [PATCH 01/19] Add a new token GREATER_BAR_RBRACE --- src/Compiler/pars.fsy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 7cac0ad0dc0..e0ac10fdaf1 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -84,7 +84,7 @@ let parse_error_rich = Some(fun (ctxt: ParseErrorContext<_>) -> %token EXCEPTION FALSE FOR FUN FUNCTION IF IN JOIN_IN FINALLY DO_BANG %token LAZY OLAZY MATCH MATCH_BANG MUTABLE NEW OF %token OPEN OR REC THEN TO TRUE TRY TYPE VAL INLINE INTERFACE INSTANCE CONST -%token WHEN WHILE WHILE_BANG WITH HASH AMP AMP_AMP QUOTE LPAREN RPAREN RPAREN_COMING_SOON RPAREN_IS_HERE STAR COMMA RARROW GREATER_BAR_RBRACK LPAREN_STAR_RPAREN +%token WHEN WHILE WHILE_BANG WITH HASH AMP AMP_AMP QUOTE LPAREN RPAREN RPAREN_COMING_SOON RPAREN_IS_HERE STAR COMMA RARROW GREATER_BAR_RBRACK GREATER_BAR_RBRACE LPAREN_STAR_RPAREN %token QMARK QMARK_QMARK DOT COLON COLON_COLON COLON_GREATER COLON_QMARK_GREATER COLON_QMARK COLON_EQUALS SEMICOLON %token SEMICOLON_SEMICOLON LARROW EQUALS LBRACK LBRACK_BAR LBRACE_BAR LBRACK_LESS %token BAR_RBRACK BAR_RBRACE UNDERSCORE From 074559352cbfaf07dc587334dc1bd5a2f2c5fec9 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Sun, 11 May 2025 15:32:06 +0100 Subject: [PATCH 02/19] Update lex.fsl --- src/Compiler/lex.fsl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Compiler/lex.fsl b/src/Compiler/lex.fsl index 34bfe4bfe17..ca65c234247 100644 --- a/src/Compiler/lex.fsl +++ b/src/Compiler/lex.fsl @@ -903,6 +903,8 @@ rule token (args: LexArgs) (skip: bool) = parse | ">" { GREATER false } + | ">|}" { GREATER_BAR_RBRACE } + | "[<" { LBRACK_LESS } | "]" { RBRACK } From 120c02c5e18f7d4aeef5b7b4aac16e268c54c94a Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Sun, 11 May 2025 15:33:11 +0100 Subject: [PATCH 03/19] Update FSStrings --- src/Compiler/FSStrings.resx | 3 +++ src/Compiler/xlf/FSStrings.cs.xlf | 5 +++++ src/Compiler/xlf/FSStrings.de.xlf | 5 +++++ src/Compiler/xlf/FSStrings.es.xlf | 5 +++++ src/Compiler/xlf/FSStrings.fr.xlf | 5 +++++ src/Compiler/xlf/FSStrings.it.xlf | 5 +++++ src/Compiler/xlf/FSStrings.ja.xlf | 5 +++++ src/Compiler/xlf/FSStrings.ko.xlf | 5 +++++ src/Compiler/xlf/FSStrings.pl.xlf | 5 +++++ src/Compiler/xlf/FSStrings.pt-BR.xlf | 5 +++++ src/Compiler/xlf/FSStrings.ru.xlf | 5 +++++ src/Compiler/xlf/FSStrings.tr.xlf | 5 +++++ src/Compiler/xlf/FSStrings.zh-Hans.xlf | 5 +++++ src/Compiler/xlf/FSStrings.zh-Hant.xlf | 5 +++++ 14 files changed, 68 insertions(+) diff --git a/src/Compiler/FSStrings.resx b/src/Compiler/FSStrings.resx index abb2bb57f55..8453259ea1b 100644 --- a/src/Compiler/FSStrings.resx +++ b/src/Compiler/FSStrings.resx @@ -357,6 +357,9 @@ symbol '=' + + symbol '>|}' + symbol '>|]' diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf index 698e7180ad6..cfa0c8bddb7 100644 --- a/src/Compiler/xlf/FSStrings.cs.xlf +++ b/src/Compiler/xlf/FSStrings.cs.xlf @@ -82,6 +82,11 @@ symbol ..^ + + symbol '>|}' + symbol '>|}' + + interpolated string interpolovaný řetězec diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf index ebfb525eb2a..e81e671661a 100644 --- a/src/Compiler/xlf/FSStrings.de.xlf +++ b/src/Compiler/xlf/FSStrings.de.xlf @@ -82,6 +82,11 @@ Symbol "..^" + + symbol '>|}' + symbol '>|}' + + interpolated string Interpolierte Zeichenfolge diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf index 46816a23aba..9e78f3ddd08 100644 --- a/src/Compiler/xlf/FSStrings.es.xlf +++ b/src/Compiler/xlf/FSStrings.es.xlf @@ -82,6 +82,11 @@ símbolo "..^" + + symbol '>|}' + symbol '>|}' + + interpolated string cadena interpolada diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf index 7e8f9df4ee3..ccedd3ac360 100644 --- a/src/Compiler/xlf/FSStrings.fr.xlf +++ b/src/Compiler/xlf/FSStrings.fr.xlf @@ -82,6 +82,11 @@ symbole '..^' + + symbol '>|}' + symbol '>|}' + + interpolated string chaîne interpolée diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf index 004e8d04e13..e5545d56799 100644 --- a/src/Compiler/xlf/FSStrings.it.xlf +++ b/src/Compiler/xlf/FSStrings.it.xlf @@ -82,6 +82,11 @@ simbolo '..^' + + symbol '>|}' + symbol '>|}' + + interpolated string stringa interpolata diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf index b7e4a21e670..631370c20e9 100644 --- a/src/Compiler/xlf/FSStrings.ja.xlf +++ b/src/Compiler/xlf/FSStrings.ja.xlf @@ -82,6 +82,11 @@ シンボル '..^' + + symbol '>|}' + symbol '>|}' + + interpolated string 補間された文字列 diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf index edee12a29a2..084e56072c4 100644 --- a/src/Compiler/xlf/FSStrings.ko.xlf +++ b/src/Compiler/xlf/FSStrings.ko.xlf @@ -82,6 +82,11 @@ 기호 '..^' + + symbol '>|}' + symbol '>|}' + + interpolated string 보간 문자열 diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf index b50fb8fc188..f6e7003e75d 100644 --- a/src/Compiler/xlf/FSStrings.pl.xlf +++ b/src/Compiler/xlf/FSStrings.pl.xlf @@ -82,6 +82,11 @@ symbol „..^” + + symbol '>|}' + symbol '>|}' + + interpolated string ciąg interpolowany diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf index f94ce79cd97..72178364b24 100644 --- a/src/Compiler/xlf/FSStrings.pt-BR.xlf +++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf @@ -82,6 +82,11 @@ símbolo '..^' + + symbol '>|}' + symbol '>|}' + + interpolated string cadeia de caracteres interpolada diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf index 6df88d26d49..6f2c47d0d10 100644 --- a/src/Compiler/xlf/FSStrings.ru.xlf +++ b/src/Compiler/xlf/FSStrings.ru.xlf @@ -82,6 +82,11 @@ символ "..^" + + symbol '>|}' + symbol '>|}' + + interpolated string интерполированная строка diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf index 59fc6b69625..0c41ee99672 100644 --- a/src/Compiler/xlf/FSStrings.tr.xlf +++ b/src/Compiler/xlf/FSStrings.tr.xlf @@ -82,6 +82,11 @@ '..^' sembolü + + symbol '>|}' + symbol '>|}' + + interpolated string düz metin arasına kod eklenmiş dize diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf index f97800458f1..dc22dbeb28b 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf @@ -82,6 +82,11 @@ 符号 "..^" + + symbol '>|}' + symbol '>|}' + + interpolated string 内插字符串 diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf index 2f0181b62d6..bcb553c7de1 100644 --- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf +++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf @@ -82,6 +82,11 @@ 符號 '..^' + + symbol '>|}' + symbol '>|}' + + interpolated string 插補字串 From c87844d6fa2c20879cb32c1c1a50a8a6a6f781d8 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Sun, 11 May 2025 15:33:58 +0100 Subject: [PATCH 04/19] Update ServiceLexing --- src/Compiler/Service/ServiceLexing.fs | 3 +++ src/Compiler/Service/ServiceLexing.fsi | 1 + 2 files changed, 4 insertions(+) diff --git a/src/Compiler/Service/ServiceLexing.fs b/src/Compiler/Service/ServiceLexing.fs index 8e97816290f..d75f9756db9 100644 --- a/src/Compiler/Service/ServiceLexing.fs +++ b/src/Compiler/Service/ServiceLexing.fs @@ -283,6 +283,7 @@ module internal TokenClassifications = | LBRACE_BAR -> (FSharpTokenColorKind.Punctuation, FSharpTokenCharKind.Delimiter, FSharpTokenTriggerClass.MatchBraces) | GREATER_RBRACK + | GREATER_BAR_RBRACE | GREATER_BAR_RBRACK -> (FSharpTokenColorKind.Punctuation, FSharpTokenCharKind.Delimiter, FSharpTokenTriggerClass.None) | RQUOTE _ @@ -1371,6 +1372,7 @@ type FSharpTokenKind = | Comma | RightArrow | GreaterBarRightBracket + | GreaterBarRightBrace | LeftParenthesisStarRightParenthesis | Open | Or @@ -1581,6 +1583,7 @@ type FSharpToken = | STAR -> FSharpTokenKind.Star | COMMA -> FSharpTokenKind.Comma | RARROW -> FSharpTokenKind.RightArrow + | GREATER_BAR_RBRACE -> FSharpTokenKind.GreaterBarRightBrace | GREATER_BAR_RBRACK -> FSharpTokenKind.GreaterBarRightBracket | LPAREN_STAR_RPAREN -> FSharpTokenKind.LeftParenthesisStarRightParenthesis | OPEN -> FSharpTokenKind.Open diff --git a/src/Compiler/Service/ServiceLexing.fsi b/src/Compiler/Service/ServiceLexing.fsi index ee2ab7411d5..3aa84237d3d 100755 --- a/src/Compiler/Service/ServiceLexing.fsi +++ b/src/Compiler/Service/ServiceLexing.fsi @@ -456,6 +456,7 @@ type public FSharpTokenKind = | Comma | RightArrow | GreaterBarRightBracket + | GreaterBarRightBrace | LeftParenthesisStarRightParenthesis | Open | Or From afd4adffcb84f655161d7536c243d999f79e68dd Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Sun, 11 May 2025 15:34:28 +0100 Subject: [PATCH 05/19] Update CompilerDiagnostics --- src/Compiler/Driver/CompilerDiagnostics.fs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index 68813e69a83..abba213808d 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -1135,6 +1135,7 @@ type Exception with | Parser.TOKEN_COLON_EQUALS -> SR.GetString("Parser.TOKEN.COLON.EQUALS") | Parser.TOKEN_LARROW -> SR.GetString("Parser.TOKEN.LARROW") | Parser.TOKEN_EQUALS -> SR.GetString("Parser.TOKEN.EQUALS") + | Parser.TOKEN_GREATER_BAR_RBRACE -> SR.GetString("Parser.TOKEN.GREATER.BAR.RBRACE") | Parser.TOKEN_GREATER_BAR_RBRACK -> SR.GetString("Parser.TOKEN.GREATER.BAR.RBRACK") | Parser.TOKEN_MINUS -> SR.GetString("Parser.TOKEN.MINUS") | Parser.TOKEN_ADJACENT_PREFIX_OP -> SR.GetString("Parser.TOKEN.ADJACENT.PREFIX.OP") From 28cf61f8b23edffb584ee420c3d22058ba6e3bda Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Sun, 11 May 2025 15:34:53 +0100 Subject: [PATCH 06/19] Update LexFilter --- src/Compiler/SyntaxTree/LexFilter.fs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Compiler/SyntaxTree/LexFilter.fs b/src/Compiler/SyntaxTree/LexFilter.fs index 20af46524b0..1b7c07fa1cb 100644 --- a/src/Compiler/SyntaxTree/LexFilter.fs +++ b/src/Compiler/SyntaxTree/LexFilter.fs @@ -1093,7 +1093,7 @@ type LexFilterImpl ( scanAhead nParen else false - | GREATER _ | GREATER_RBRACK | GREATER_BAR_RBRACK -> + | GREATER _ | GREATER_RBRACK | GREATER_BAR_RBRACK | GREATER_BAR_RBRACE -> let nParen = nParen - 1 let hasAfterOp = (match lookaheadToken with GREATER _ -> false | _ -> true) if nParen > 0 then @@ -1201,6 +1201,10 @@ type LexFilterImpl ( delayToken (pool.UseShiftedLocation(tokenTup, INFIX_AT_HAT_OP "@", 1, 0)) delayToken (pool.UseShiftedLocation(tokenTup, LESS res, 0, -1)) pool.Return tokenTup + | GREATER_BAR_RBRACE -> + delayToken (pool.UseShiftedLocation(tokenTup, BAR_RBRACE, 1, 0)) + delayToken (pool.UseShiftedLocation(tokenTup, GREATER res, 0, -2)) + pool.Return tokenTup | GREATER_BAR_RBRACK -> delayToken (pool.UseShiftedLocation(tokenTup, BAR_RBRACK, 1, 0)) delayToken (pool.UseShiftedLocation(tokenTup, GREATER res, 0, -2)) From 95180ae196221d5aeefcc0278c7cd8d23969f512 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Sun, 11 May 2025 15:45:45 +0100 Subject: [PATCH 07/19] Add SyntaxTree tests --- .../Expression/AnonymousRecords-07.fs | 10 +++ .../Expression/AnonymousRecords-07.fs.bsl | 54 ++++++++++++ .../Expression/AnonymousRecords-08.fs | 9 ++ .../Expression/AnonymousRecords-08.fs.bsl | 82 +++++++++++++++++++ 4 files changed, 155 insertions(+) create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs new file mode 100644 index 00000000000..69965ae8be3 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs @@ -0,0 +1,10 @@ +module Module + +{|a=1 |} + +{|a=1|} + +{| a=1|} + +{| a=1 |} + diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl new file mode 100644 index 00000000000..27c97d965bf --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl @@ -0,0 +1,54 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonymousRecords-07.fs", false, + QualifiedNameOfFile Module, [], [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), + Const + (Measure + (Int32 1, (3,4--3,5), + Seq ([Named ([m], (3,6--3,7))], (3,6--3,7)), + { LessRange = (3,5--3,6) + GreaterRange = (3,7--3,8) }), (3,4--3,8)))], + (3,0--3,11), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,11)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), + Const + (Measure + (Int32 1, (5,4--5,5), + Seq ([Named ([m], (5,6--5,7))], (5,6--5,7)), + { LessRange = (5,5--5,6) + GreaterRange = (5,7--5,8) }), (5,4--5,8)))], + (5,0--5,10), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,10)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), + Const + (Measure + (Int32 1, (7,5--7,6), + Seq ([Named ([m], (7,7--7,8))], (7,7--7,8)), + { LessRange = (7,6--7,7) + GreaterRange = (7,8--7,9) }), (7,5--7,9)))], + (7,0--7,11), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,11)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), + Const + (Measure + (Int32 1, (9,5--9,6), + Seq ([Named ([m], (9,7--9,8))], (9,7--9,8)), + { LessRange = (9,6--9,7) + GreaterRange = (9,8--9,9) }), (9,5--9,9)))], + (9,0--9,12), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,12))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--9,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs new file mode 100644 index 00000000000..10830a528a3 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs @@ -0,0 +1,9 @@ +module Module + +{|a=1; b=2 |} + +{|a=1; b=2|} + +{| a=1; b=2|} + +{| a=1; b=2 |} diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl new file mode 100644 index 00000000000..60c29767b77 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl @@ -0,0 +1,82 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonymousRecords-08.fs", false, + QualifiedNameOfFile Module, [], [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), + Const + (Measure + (Int32 1, (3,4--3,5), + Seq ([Named ([m], (3,6--3,7))], (3,6--3,7)), + { LessRange = (3,5--3,6) + GreaterRange = (3,7--3,8) }), (3,4--3,8))); + (SynLongIdent ([b], [], [None]), Some (3,11--3,12), + Const + (Measure + (Int32 2, (3,12--3,13), + Seq ([Named ([m], (3,14--3,15))], (3,14--3,15)), + { LessRange = (3,13--3,14) + GreaterRange = (3,15--3,16) }), (3,12--3,16)))], + (3,0--3,19), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,19)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), + Const + (Measure + (Int32 1, (5,4--5,5), + Seq ([Named ([m], (5,6--5,7))], (5,6--5,7)), + { LessRange = (5,5--5,6) + GreaterRange = (5,7--5,8) }), (5,4--5,8))); + (SynLongIdent ([b], [], [None]), Some (5,11--5,12), + Const + (Measure + (Int32 2, (5,12--5,13), + Seq ([Named ([m], (5,14--5,15))], (5,14--5,15)), + { LessRange = (5,13--5,14) + GreaterRange = (5,15--5,16) }), (5,12--5,16)))], + (5,0--5,18), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,18)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), + Const + (Measure + (Int32 1, (7,5--7,6), + Seq ([Named ([m], (7,7--7,8))], (7,7--7,8)), + { LessRange = (7,6--7,7) + GreaterRange = (7,8--7,9) }), (7,5--7,9))); + (SynLongIdent ([b], [], [None]), Some (7,12--7,13), + Const + (Measure + (Int32 2, (7,13--7,14), + Seq ([Named ([m], (7,15--7,16))], (7,15--7,16)), + { LessRange = (7,14--7,15) + GreaterRange = (7,16--7,17) }), (7,13--7,17)))], + (7,0--7,19), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,19)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), + Const + (Measure + (Int32 1, (9,5--9,6), + Seq ([Named ([m], (9,7--9,8))], (9,7--9,8)), + { LessRange = (9,6--9,7) + GreaterRange = (9,8--9,9) }), (9,5--9,9))); + (SynLongIdent ([b], [], [None]), Some (9,12--9,13), + Const + (Measure + (Int32 2, (9,13--9,14), + Seq ([Named ([m], (9,15--9,16))], (9,15--9,16)), + { LessRange = (9,14--9,15) + GreaterRange = (9,16--9,17) }), (9,13--9,17)))], + (9,0--9,20), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,20))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--9,20), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) From 15ec29120815a7d2fc8e669bd40dbf83573014ae Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Sun, 11 May 2025 15:47:20 +0100 Subject: [PATCH 08/19] more tests --- .../Types/RecordTypes/AnonymousRecords.fs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs index 354539ed7c1..a1147bbe8d4 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs @@ -19,6 +19,23 @@ module AnonRecd = |> shouldFail |> withErrorCode 3522 |> withMessage "The field 'A' appears multiple times in this record expression." + + [] + let ``Anonymous Record with unit of measures`` () = + FSharp """ +namespace FSharpTest + +[] +type m + +module AnonRecd = + let a = {|a=1|} + let b = {|a=1; b=2|} + let c = {|a=1 |} + let d = {| a=1; b=2; c=3 |} +""" + |> compile + |> shouldSucceed [] let ``Anonymous Record missing single field`` () = From 5d72ba9b1e824fd4ca762c94cf244d65c5d71ba4 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Sun, 11 May 2025 16:30:36 +0100 Subject: [PATCH 09/19] Update baselines --- ...harp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl | 5 +++++ ...rp.Compiler.Service.SurfaceArea.netstandard20.release.bsl | 5 +++++ 2 files changed, 10 insertions(+) mode change 100755 => 100644 tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl mode change 100755 => 100644 tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl old mode 100755 new mode 100644 index f89f7a406be..2ec959621d2 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl @@ -11296,6 +11296,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Function FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 FunkyOperatorName FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Global FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Greater +FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterBarRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Hash @@ -11491,6 +11492,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsFunction FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsFunkyOperatorName FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGlobal FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreater +FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterBarRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsHash @@ -11682,6 +11684,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsFunction() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsFunkyOperatorName() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGlobal() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreater() +FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterBarRightBrace() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterBarRightBracket() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterRightBracket() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsHash() @@ -11873,6 +11876,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind FunkyOperatorName FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Global FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Greater +FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterBarRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Hash @@ -12064,6 +12068,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_FunkyOperatorName() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Global() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Greater() +FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterBarRightBrace() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterBarRightBracket() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterRightBracket() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Hash() diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl old mode 100755 new mode 100644 index f89f7a406be..2ec959621d2 --- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl +++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl @@ -11296,6 +11296,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Function FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 FunkyOperatorName FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Global FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Greater +FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterBarRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 GreaterRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind+Tags: Int32 Hash @@ -11491,6 +11492,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsFunction FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsFunkyOperatorName FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGlobal FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreater +FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterBarRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsGreaterRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean IsHash @@ -11682,6 +11684,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsFunction() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsFunkyOperatorName() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGlobal() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreater() +FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterBarRightBrace() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterBarRightBracket() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsGreaterRightBracket() FSharp.Compiler.Tokenization.FSharpTokenKind: Boolean get_IsHash() @@ -11873,6 +11876,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind FunkyOperatorName FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Global FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Greater +FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterBarRightBrace FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterBarRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind GreaterRightBracket FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind Hash @@ -12064,6 +12068,7 @@ FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FShar FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_FunkyOperatorName() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Global() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Greater() +FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterBarRightBrace() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterBarRightBracket() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_GreaterRightBracket() FSharp.Compiler.Tokenization.FSharpTokenKind: FSharp.Compiler.Tokenization.FSharpTokenKind get_Hash() From 306e18f39bdc75df22909b1056d47c5a45176126 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Sun, 11 May 2025 16:51:05 +0100 Subject: [PATCH 10/19] Add more tests --- .../Expression/AnonymousRecords-09.fs | 10 ++ .../Expression/AnonymousRecords-09.fs.bsl | 46 +++++++ .../Expression/AnonymousRecords-10.fs | 10 ++ .../Expression/AnonymousRecords-10.fs.bsl | 54 ++++++++ .../Expression/AnonymousRecords-11.fs | 10 ++ .../Expression/AnonymousRecords-11.fs.bsl | 126 ++++++++++++++++++ .../Expression/AnonymousRecords-12.fs | 10 ++ .../Expression/AnonymousRecords-12.fs.bsl | 46 +++++++ .../Expression/AnonymousRecords-13.fs | 6 + .../Expression/AnonymousRecords-13.fs.bsl | 44 ++++++ 10 files changed, 362 insertions(+) create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs create mode 100644 tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs new file mode 100644 index 00000000000..00d316e9d42 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs @@ -0,0 +1,10 @@ +module Module + +{|a=typeof|} + +{|a=typeof |} + +{| a=typeof|} + +{| a=typeof |} + diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl new file mode 100644 index 00000000000..76e9d38d76a --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl @@ -0,0 +1,46 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonymousRecords-09.fs", false, + QualifiedNameOfFile Module, [], [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), + TypeApp + (Ident typeof, (3,10--3,11), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (3,14--3,15), (3,10--3,15), (3,4--3,15)))], + (3,0--3,17), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,17)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), + TypeApp + (Ident typeof, (5,10--5,11), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (5,14--5,15), (5,10--5,15), (5,4--5,15)))], + (5,0--5,18), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,18)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), + TypeApp + (Ident typeof, (7,11--7,12), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (7,15--7,16), (7,11--7,16), (7,5--7,16)))], + (7,0--7,18), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,18)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), + TypeApp + (Ident typeof, (9,11--9,12), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (9,15--9,16), (9,11--9,16), (9,5--9,16)))], + (9,0--9,19), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,19))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--9,19), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs new file mode 100644 index 00000000000..f4054ccd7f4 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs @@ -0,0 +1,10 @@ +module Module + +{|a=typedefof<_ option>|} + +{|a=typedefof<_ option> |} + +{| a=typedefof<_ option>|} + +{| a=typedefof<_ option> |} + diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl new file mode 100644 index 00000000000..d768c426ac9 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl @@ -0,0 +1,54 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonymousRecords-10.fs", false, + QualifiedNameOfFile Module, [], [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), + TypeApp + (Ident typedefof, (3,13--3,14), + [App + (LongIdent (SynLongIdent ([option], [], [None])), None, + [Anon (3,14--3,15)], [], None, true, (3,14--3,22))], + [], Some (3,22--3,23), (3,13--3,23), (3,4--3,23)))], + (3,0--3,25), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,25)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), + TypeApp + (Ident typedefof, (5,13--5,14), + [App + (LongIdent (SynLongIdent ([option], [], [None])), None, + [Anon (5,14--5,15)], [], None, true, (5,14--5,22))], + [], Some (5,22--5,23), (5,13--5,23), (5,4--5,23)))], + (5,0--5,26), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,26)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), + TypeApp + (Ident typedefof, (7,14--7,15), + [App + (LongIdent (SynLongIdent ([option], [], [None])), None, + [Anon (7,15--7,16)], [], None, true, (7,15--7,23))], + [], Some (7,23--7,24), (7,14--7,24), (7,5--7,24)))], + (7,0--7,26), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,26)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), + TypeApp + (Ident typedefof, (9,14--9,15), + [App + (LongIdent (SynLongIdent ([option], [], [None])), None, + [Anon (9,15--9,16)], [], None, true, (9,15--9,23))], + [], Some (9,23--9,24), (9,14--9,24), (9,5--9,24)))], + (9,0--9,27), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,27))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--9,27), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs new file mode 100644 index 00000000000..f7f786136ba --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs @@ -0,0 +1,10 @@ +module Module + +let f<'T> = {|a=nameof<'T>|} + +let f<'T> = {|a=nameof<'T> |} + +let f<'T> = {| a=nameof<'T>|} + +let f<'T> = {| a=nameof<'T> |} + diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl new file mode 100644 index 00000000000..56a0867c899 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl @@ -0,0 +1,126 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonymousRecords-11.fs", false, + QualifiedNameOfFile Module, [], [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((3,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + LongIdent + (SynLongIdent ([f], [], [None]), None, + Some + (SynValTyparDecls + (Some + (PostfixList + ([SynTyparDecl + ([], SynTypar (T, None, false), [], + { AmpersandRanges = [] })], [], (3,5--3,9))), + false)), Pats [], None, (3,4--3,9)), None, + AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (3,15--3,16), + TypeApp + (Ident nameof, (3,22--3,23), + [Var (SynTypar (T, None, false), (3,23--3,25))], [], + Some (3,25--3,26), (3,22--3,26), (3,16--3,26)))], + (3,12--3,28), { OpeningBraceRange = (3,12--3,14) }), + (3,4--3,9), NoneAtLet, { LeadingKeyword = Let (3,0--3,3) + InlineKeyword = None + EqualsRange = Some (3,10--3,11) })], + (3,0--3,28)); + Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((5,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + LongIdent + (SynLongIdent ([f], [], [None]), None, + Some + (SynValTyparDecls + (Some + (PostfixList + ([SynTyparDecl + ([], SynTypar (T, None, false), [], + { AmpersandRanges = [] })], [], (5,5--5,9))), + false)), Pats [], None, (5,4--5,9)), None, + AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (5,15--5,16), + TypeApp + (Ident nameof, (5,22--5,23), + [Var (SynTypar (T, None, false), (5,23--5,25))], [], + Some (5,25--5,26), (5,22--5,26), (5,16--5,26)))], + (5,12--5,29), { OpeningBraceRange = (5,12--5,14) }), + (5,4--5,9), NoneAtLet, { LeadingKeyword = Let (5,0--5,3) + InlineKeyword = None + EqualsRange = Some (5,10--5,11) })], + (5,0--5,29)); + Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((7,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + LongIdent + (SynLongIdent ([f], [], [None]), None, + Some + (SynValTyparDecls + (Some + (PostfixList + ([SynTyparDecl + ([], SynTypar (T, None, false), [], + { AmpersandRanges = [] })], [], (7,5--7,9))), + false)), Pats [], None, (7,4--7,9)), None, + AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (7,16--7,17), + TypeApp + (Ident nameof, (7,23--7,24), + [Var (SynTypar (T, None, false), (7,24--7,26))], [], + Some (7,26--7,27), (7,23--7,27), (7,17--7,27)))], + (7,12--7,29), { OpeningBraceRange = (7,12--7,14) }), + (7,4--7,9), NoneAtLet, { LeadingKeyword = Let (7,0--7,3) + InlineKeyword = None + EqualsRange = Some (7,10--7,11) })], + (7,0--7,29)); + Let + (false, + [SynBinding + (None, Normal, false, false, [], + PreXmlDoc ((9,0), FSharp.Compiler.Xml.XmlDocCollector), + SynValData + (None, SynValInfo ([], SynArgInfo ([], false, None)), None), + LongIdent + (SynLongIdent ([f], [], [None]), None, + Some + (SynValTyparDecls + (Some + (PostfixList + ([SynTyparDecl + ([], SynTypar (T, None, false), [], + { AmpersandRanges = [] })], [], (9,5--9,9))), + false)), Pats [], None, (9,4--9,9)), None, + AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (9,16--9,17), + TypeApp + (Ident nameof, (9,23--9,24), + [Var (SynTypar (T, None, false), (9,24--9,26))], [], + Some (9,26--9,27), (9,23--9,27), (9,17--9,27)))], + (9,12--9,30), { OpeningBraceRange = (9,12--9,14) }), + (9,4--9,9), NoneAtLet, { LeadingKeyword = Let (9,0--9,3) + InlineKeyword = None + EqualsRange = Some (9,10--9,11) })], + (9,0--9,30))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--9,30), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs new file mode 100644 index 00000000000..4ef04e9a312 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs @@ -0,0 +1,10 @@ +module Module + +{|a=id|} + +{|a=id |} + +{| a=id|} + +{| a=id |} + diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl new file mode 100644 index 00000000000..a28dc181a37 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl @@ -0,0 +1,46 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonymousRecords-12.fs", false, + QualifiedNameOfFile Module, [], [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (3,3--3,4), + TypeApp + (Ident id, (3,6--3,7), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (3,10--3,11), (3,6--3,11), (3,4--3,11)))], + (3,0--3,13), { OpeningBraceRange = (3,0--3,2) }), (3,0--3,13)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (5,3--5,4), + TypeApp + (Ident id, (5,6--5,7), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (5,10--5,11), (5,6--5,11), (5,4--5,11)))], + (5,0--5,14), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,14)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (7,4--7,5), + TypeApp + (Ident id, (7,7--7,8), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (7,11--7,12), (7,7--7,12), (7,5--7,12)))], + (7,0--7,14), { OpeningBraceRange = (7,0--7,2) }), (7,0--7,14)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (9,4--9,5), + TypeApp + (Ident id, (9,7--9,8), + [LongIdent (SynLongIdent ([int], [], [None]))], [], + Some (9,11--9,12), (9,7--9,12), (9,5--9,12)))], + (9,0--9,15), { OpeningBraceRange = (9,0--9,2) }), (9,0--9,15))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--9,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs new file mode 100644 index 00000000000..18ef9d998ab --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs @@ -0,0 +1,6 @@ +module Module + +{|a = <@ 3 @> |} + +{|a = <@ 3 @>|} + diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl new file mode 100644 index 00000000000..ae453491af1 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl @@ -0,0 +1,44 @@ +ImplFile + (ParsedImplFileInput + ("/root/Expression/AnonymousRecords-13.fs", false, + QualifiedNameOfFile Module, [], [], + [SynModuleOrNamespace + ([Module], false, NamedModule, + [Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (3,4--3,5), + Quote + (Ident op_Quotation, false, Const (Int32 3, (3,9--3,10)), + false, (3,6--3,13)))], (3,0--3,16), + { OpeningBraceRange = (3,0--3,2) }), (3,0--3,16)); + Expr + (AnonRecd + (false, None, + [(SynLongIdent ([a], [], [None]), Some (5,4--5,5), + FromParseError + (Quote + (Ident op_Quotation, false, + App + (NonAtomic, false, + App + (NonAtomic, true, + LongIdent + (false, + SynLongIdent + ([op_AtGreaterBar], [], + [Some (OriginalNotation "@>|")]), None, + (5,11--5,14)), Const (Int32 3, (5,9--5,10)), + (5,9--5,14)), + ArbitraryAfterError ("declExprInfix", (5,14--5,14)), + (5,9--5,14)), false, (5,6--5,15)), (5,6--5,15)))], + (5,0--5,15), { OpeningBraceRange = (5,0--5,2) }), (5,0--5,15))], + PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, + (1,0--5,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), + { ConditionalDirectives = [] + CodeComments = [] }, set [])) + +(5,11)-(5,14) parse error Unexpected token '@>|' or incomplete expression +(5,14)-(5,15) parse error Unexpected symbol '}' in quotation literal. Expected end of quotation or other token. +(5,6)-(5,8) parse error Unmatched '<@ @>' +(5,0)-(5,2) parse error Unmatched '{|' From 8ba39bedd821ec42a558d12d92473cac1e4a8f41 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Sun, 11 May 2025 19:23:59 +0100 Subject: [PATCH 11/19] release notes --- docs/release-notes/.FSharp.Compiler.Service/9.0.300.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index e187f285d4b..847b019101b 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -30,6 +30,7 @@ * Make `[]` combination work([PR #18444](https://github.com/dotnet/fsharp/pull/18444/)) * Fix code completion considers types from own namespace non-imported ([PR #18518](https://github.com/dotnet/fsharp/issues/18518)) * Code completion: fix getting qualifier expression in do statements in type decls ([PR #18524](https://github.com/dotnet/fsharp/pull/18524)) +* Fix parsing errors using anonymous records and units of measures ([PR #18543](https://github.com/dotnet/fsharp/pull/18543)) * Fixed: [#18441](https://github.com/dotnet/fsharp/issues/18441) FSI multi-emit unstable. ([PR #18465](https://github.com/dotnet/fsharp/pull/18465)) ### Added From e0ef7dfc54b99a437e368dbd6d66c628819bd649 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Sun, 11 May 2025 19:29:34 +0100 Subject: [PATCH 12/19] ILVerify --- .../ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl | 10 +++++----- ...fy_FSharp.Compiler.Service_Debug_netstandard2.0.bsl | 10 +++++----- ...ilverify_FSharp.Compiler.Service_Release_net9.0.bsl | 10 +++++----- ..._FSharp.Compiler.Service_Release_netstandard2.0.bsl | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index fd4b4d78bd0..7ca79b1f946 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -24,11 +24,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3509-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@110::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::getCompilerOption([FSharp.Compiler.Service]FSharp.Compiler.CompilerOptions+CompilerOption, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000E6][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::AddPathMapping([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, string)][offset 0x0000000B][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 4eaf1633b58..f493c9f504a 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -35,11 +35,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x00000059][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000DA][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1424-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000605][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2495-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CreateILModule+MainModuleBuilder::ConvertProductVersionToILVersionInfo(string)][offset 0x00000011][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index 0267e2b1bb0..335187210f9 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -23,11 +23,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3509-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@291-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@291-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index 37aaa79a6f2..54a6e8ae014 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -34,11 +34,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000BB][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1424-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000620][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@921-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2495-3::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000030][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@291-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@291-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. From 729ebbb9b587606fbbdefe338a2fc1adabfee6d0 Mon Sep 17 00:00:00 2001 From: Edgar Gonzalez Date: Sun, 11 May 2025 22:21:49 +0100 Subject: [PATCH 13/19] more tests --- .../Types/RecordTypes/AnonymousRecords.fs | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs index a1147bbe8d4..65038cbcf71 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs @@ -37,6 +37,45 @@ module AnonRecd = |> compile |> shouldSucceed + [] + let ``Anonymous Record with typeof`` () = + FSharp """ +namespace FSharpTest +module AnonRecd = + let a = {|a=typeof|} + let b = {|a=typeof |} + let c = {| a=typeof|} + let d = {| a=typeof |} +""" + |> compile + |> shouldSucceed + + [] + let ``Anonymous Record with typedefof`` () = + FSharp """ +namespace FSharpTest +module AnonRecd = + let a = {|a=typedefof<_ option>|} + let b = {|a=typedefof<_ option> |} + let c = {| a=typedefof<_ option>|} + let d = {| a=typedefof<_ option> |} +""" + |> compile + |> shouldSucceed + + [] + let ``Anonymous Record with nameof`` () = + FSharp """ +namespace FSharpTest +module AnonRecd = + let a<'T> = {|a=nameof<'T>|} + let b<'T> = {|a=nameof<'T> |} + let c<'T> = {| a=nameof<'T>|} + let d<'T> = {| a=nameof<'T> |} +""" + |> compile + |> shouldSucceed + [] let ``Anonymous Record missing single field`` () = Fsx """ From d6457eddfecdf59a80f31890bdf8931827b74c1d Mon Sep 17 00:00:00 2001 From: edgargonzalez Date: Thu, 15 May 2025 20:34:12 +0100 Subject: [PATCH 14/19] update syntax tree tests --- .../data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl | 3 ++- .../data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl | 3 ++- .../data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl | 3 ++- .../data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl | 3 ++- .../data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl | 3 ++- .../data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl | 3 ++- .../data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl | 3 ++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl index 27c97d965bf..a8ff99d1b82 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/AnonymousRecords-07.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -51,4 +51,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,12), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl index 60c29767b77..ed640191c59 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/AnonymousRecords-08.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -79,4 +79,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,20), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl index 76e9d38d76a..ec7c2e4e312 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/AnonymousRecords-09.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -43,4 +43,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,19), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl index d768c426ac9..a30127b522f 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/AnonymousRecords-10.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -51,4 +51,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,27), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl index 56a0867c899..180ed425c9e 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/AnonymousRecords-11.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Let @@ -123,4 +123,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,30), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl index a28dc181a37..1de6c8767d2 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/AnonymousRecords-12.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -43,4 +43,5 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--9,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) diff --git a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl index ae453491af1..93fd93c0088 100644 --- a/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl @@ -1,7 +1,7 @@ ImplFile (ParsedImplFileInput ("/root/Expression/AnonymousRecords-13.fs", false, - QualifiedNameOfFile Module, [], [], + QualifiedNameOfFile Module, [], [SynModuleOrNamespace ([Module], false, NamedModule, [Expr @@ -36,6 +36,7 @@ ImplFile PreXmlDoc ((1,0), FSharp.Compiler.Xml.XmlDocCollector), [], None, (1,0--5,15), { LeadingKeyword = Module (1,0--1,6) })], (true, true), { ConditionalDirectives = [] + WarnDirectives = [] CodeComments = [] }, set [])) (5,11)-(5,14) parse error Unexpected token '@>|' or incomplete expression From fa7cbd961896b6a7bb36f9ea9ad3469fbe8a9a07 Mon Sep 17 00:00:00 2001 From: edgargonzalez Date: Thu, 15 May 2025 20:34:43 +0100 Subject: [PATCH 15/19] Add LanguageFeature BetterAnonymousRecordParsing --- src/Compiler/FSComp.txt | 1 + src/Compiler/Facilities/LanguageFeatures.fs | 3 + src/Compiler/Facilities/LanguageFeatures.fsi | 1 + src/Compiler/SyntaxTree/LexFilter.fs | 1 + src/Compiler/xlf/FSComp.txt.cs.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.de.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.es.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.fr.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.it.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.ja.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.ko.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.pl.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.ru.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.tr.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 ++ src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 ++ .../Types/RecordTypes/AnonymousRecords.fs | 76 +++++++++++++++++++ 18 files changed, 147 insertions(+) diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 010088e958e..2c600354e1d 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1799,6 +1799,7 @@ featureDeprecatePlacesWhereSeqCanBeOmitted,"Deprecate places where 'seq' can be featureSupportValueOptionsAsOptionalParameters,"Support ValueOption as valid type for optional member parameters" featureSupportWarnWhenUnitPassedToObjArg,"Warn when unit is passed to a member accepting `obj` argument, e.g. `Method(o:obj)` will warn if called via `Method()`." featureUseBangBindingValueDiscard,"Allows use! _ = ... in computation expressions" +featureBetterAnonymousRecordParsing,"Support for better anonymous record parsing" featureScopedNowarn,"Support for scoped enabling / disabling of warnings by #warn and #nowarn directives, also inside modules" 3874,lexWarnDirectiveMustBeFirst,"#nowarn/#warnon directives must appear as the first non-whitespace characters on a line" 3875,lexWarnDirectiveMustHaveArgs,"Warn directives must have warning number(s) as argument(s)" diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 763452592a4..3c78486d7ca 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -100,6 +100,7 @@ type LanguageFeature = | SupportValueOptionsAsOptionalParameters | WarnWhenUnitPassedToObjArg | UseBangBindingValueDiscard + | BetterAnonymousRecordParsing | ScopedNowarn /// LanguageVersion management @@ -232,6 +233,7 @@ type LanguageVersion(versionText) = LanguageFeature.SupportValueOptionsAsOptionalParameters, previewVersion LanguageFeature.WarnWhenUnitPassedToObjArg, previewVersion LanguageFeature.UseBangBindingValueDiscard, previewVersion + LanguageFeature.BetterAnonymousRecordParsing, previewVersion LanguageFeature.ScopedNowarn, previewVersion ] @@ -396,6 +398,7 @@ type LanguageVersion(versionText) = | LanguageFeature.SupportValueOptionsAsOptionalParameters -> FSComp.SR.featureSupportValueOptionsAsOptionalParameters () | LanguageFeature.WarnWhenUnitPassedToObjArg -> FSComp.SR.featureSupportWarnWhenUnitPassedToObjArg () | LanguageFeature.UseBangBindingValueDiscard -> FSComp.SR.featureUseBangBindingValueDiscard () + | LanguageFeature.BetterAnonymousRecordParsing -> FSComp.SR.featureBetterAnonymousRecordParsing () | LanguageFeature.ScopedNowarn -> FSComp.SR.featureScopedNowarn () /// Get a version string associated with the given feature. diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index a452205765e..e90c8162dde 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -91,6 +91,7 @@ type LanguageFeature = | SupportValueOptionsAsOptionalParameters | WarnWhenUnitPassedToObjArg | UseBangBindingValueDiscard + | BetterAnonymousRecordParsing | ScopedNowarn /// LanguageVersion management diff --git a/src/Compiler/SyntaxTree/LexFilter.fs b/src/Compiler/SyntaxTree/LexFilter.fs index 1b7c07fa1cb..a97fb94d5e4 100644 --- a/src/Compiler/SyntaxTree/LexFilter.fs +++ b/src/Compiler/SyntaxTree/LexFilter.fs @@ -1202,6 +1202,7 @@ type LexFilterImpl ( delayToken (pool.UseShiftedLocation(tokenTup, LESS res, 0, -1)) pool.Return tokenTup | GREATER_BAR_RBRACE -> + lexbuf.CheckLanguageFeatureAndRecover LanguageFeature.BetterAnonymousRecordParsing lexbuf.LexemeRange delayToken (pool.UseShiftedLocation(tokenTup, BAR_RBRACE, 1, 0)) delayToken (pool.UseShiftedLocation(tokenTup, GREATER res, 0, -2)) pool.Return tokenTup diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index de5b2815fdc..b1f7995aade 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -307,6 +307,11 @@ atributy napravo od klíčového slova Module + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations automatické generování vlastnosti Message pro deklarace exception diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 53bf24ff3e9..894064152bd 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -307,6 +307,11 @@ Attribute rechts vom "Module"-Schlüsselwort + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations Automatische Generierung der Eigenschaft „Message“ für „exception“-Deklarationen diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index 483e820ed5c..84f33c92e86 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -307,6 +307,11 @@ atributos a la derecha de la palabra clave “módulo” + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations generación automática de la propiedad 'Message' para declaraciones 'exception' diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index f003166db2d..5dea8674f05 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -307,6 +307,11 @@ attributs à droite du mot clé 'module' + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations génération automatique de la propriété « Message » pour les déclarations « exception » diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index e4c08f83cb2..31cf6809706 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -307,6 +307,11 @@ attributi a destra della parola chiave 'module' + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations generazione automatica della proprietà 'Messaggio' per le dichiarazioni 'eccezione' diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index 7d56499a955..27c54467a22 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -307,6 +307,11 @@ 'module' キーワードの右側の属性 + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations `exception` 宣言の `Message` プロパティの自動生成 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 887f0f199f1..85172c956b0 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -307,6 +307,11 @@ 'module' 키워드 오른쪽에 있는 특성 + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations 'exception' 선언에 대한 'Message' 속성 자동 생성 diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 589e0f8535e..7c4d11d889b 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -307,6 +307,11 @@ atrybuty po prawej stronie słowa kluczowego "module" + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations Automatyczne generowanie właściwości „Wiadomość“ dla deklaracji „Wyjątek“ diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 5af5b7fcd34..31ec04e2f5f 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -307,6 +307,11 @@ atributos à direita da palavra-chave 'módulo' + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations geração automática da propriedade 'Message' para declarações de 'exception' diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index e8747be3f5c..f892ab02195 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -307,6 +307,11 @@ атрибуты справа от ключевого слова "module" + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations автоматическое создание свойства “Message” для объявлений “exception” diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index a2d6e89305c..ebb4747984b 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -307,6 +307,11 @@ 'modül' anahtar sözcüğünün sağındaki öznitelikler + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations 'exception' bildirimleri için 'Message' özelliğinin otomatik olarak oluşturulması diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index fce23f29c9a..b9d205857b7 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -307,6 +307,11 @@ "module" 关键字右侧的属性 + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations 自动生成“异常”声明的“消息”属性 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index d2563922fc3..4909980df89 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -307,6 +307,11 @@ 'module' 關鍵字右邊的屬性 + + Support for better anonymous record parsing + Support for better anonymous record parsing + + automatic generation of 'Message' property for 'exception' declarations 自動產生 'exception' 宣告的 'Message' 屬性 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs index 65038cbcf71..ef0b307853a 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs @@ -34,6 +34,28 @@ module AnonRecd = let c = {|a=1 |} let d = {| a=1; b=2; c=3 |} """ + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 8, Col 20, Line 8, Col 23, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 9, Col 28, Line 9, Col 31, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] + + [] + let ``Preview : Anonymous Record with unit of measures`` () = + FSharp """ +namespace FSharpTest + +[] +type m + +module AnonRecd = + let a = {|a=1|} + let b = {|a=1; b=2|} + let c = {|a=1 |} + let d = {| a=1; b=2; c=3 |} +""" + |> withLangVersionPreview |> compile |> shouldSucceed @@ -47,6 +69,24 @@ module AnonRecd = let c = {| a=typeof|} let d = {| a=typeof |} """ + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 4, Col 27, Line 4, Col 30, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 6, Col 28, Line 6, Col 31, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] + + [] + let ``Preview: Anonymous Record with typeof`` () = + FSharp """ +namespace FSharpTest +module AnonRecd = + let a = {|a=typeof|} + let b = {|a=typeof |} + let c = {| a=typeof|} + let d = {| a=typeof |} +""" + |> withLangVersionPreview |> compile |> shouldSucceed @@ -60,6 +100,24 @@ module AnonRecd = let c = {| a=typedefof<_ option>|} let d = {| a=typedefof<_ option> |} """ + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 4, Col 35, Line 4, Col 38, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 6, Col 36, Line 6, Col 39, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] + + [] + let ``Preview: Anonymous Record with typedefof`` () = + FSharp """ +namespace FSharpTest +module AnonRecd = + let a = {|a=typedefof<_ option>|} + let b = {|a=typedefof<_ option> |} + let c = {| a=typedefof<_ option>|} + let d = {| a=typedefof<_ option> |} +""" + |> withLangVersionPreview |> compile |> shouldSucceed @@ -73,6 +131,24 @@ module AnonRecd = let c<'T> = {| a=nameof<'T>|} let d<'T> = {| a=nameof<'T> |} """ + |> compile + |> shouldFail + |> withDiagnostics [ + (Error 3350, Line 4, Col 30, Line 4, Col 33, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + (Error 3350, Line 6, Col 31, Line 6, Col 34, "Feature 'Support for better anonymous record parsing' is not available in F# 9.0. Please use language version 'PREVIEW' or greater.") + ] + + [] + let ``Preview: Anonymous Record with nameof`` () = + FSharp """ +namespace FSharpTest +module AnonRecd = + let a<'T> = {|a=nameof<'T>|} + let b<'T> = {|a=nameof<'T> |} + let c<'T> = {| a=nameof<'T>|} + let d<'T> = {| a=nameof<'T> |} +""" + |> withLangVersionPreview |> compile |> shouldSucceed From 69ba907d7adab5c101e3227612621f179156e356 Mon Sep 17 00:00:00 2001 From: edgargonzalez Date: Thu, 15 May 2025 20:35:30 +0100 Subject: [PATCH 16/19] release notes --- docs/release-notes/.FSharp.Compiler.Service/10.0.100.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 docs/release-notes/.FSharp.Compiler.Service/10.0.100.md diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md new file mode 100644 index 00000000000..0b047b79578 --- /dev/null +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -0,0 +1,2 @@ +### Fixed +* Fix parsing errors using anonymous records and units of measures ([PR #18543](https://github.com/dotnet/fsharp/pull/18543)) From 2c5b65e964da88f1e5b9205306572574c0f90075 Mon Sep 17 00:00:00 2001 From: edgargonzalez Date: Thu, 15 May 2025 20:35:30 +0100 Subject: [PATCH 17/19] release notes --- docs/release-notes/.FSharp.Compiler.Service/10.0.100.md | 2 ++ docs/release-notes/.Language/preview.md | 1 + 2 files changed, 3 insertions(+) create mode 100644 docs/release-notes/.FSharp.Compiler.Service/10.0.100.md diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md new file mode 100644 index 00000000000..0b047b79578 --- /dev/null +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -0,0 +1,2 @@ +### Fixed +* Fix parsing errors using anonymous records and units of measures ([PR #18543](https://github.com/dotnet/fsharp/pull/18543)) diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index 4a420016a14..3d51ee2f8fd 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -6,6 +6,7 @@ * Support ValueOption + Struct attribute as optional parameter for methods ([Language suggestion #1136](https://github.com/fsharp/fslang-suggestions/issues/1136), [PR #18098](https://github.com/dotnet/fsharp/pull/18098)) * Allow `_` in `use!` bindings values (lift FS1228 restriction) ([PR #18487](https://github.com/dotnet/fsharp/pull/18487)) * Warn when `unit` is passed to an `obj`-typed argument ([PR #18330](https://github.com/dotnet/fsharp/pull/18330)) +* Fix parsing errors using anonymous records and units of measures ([PR #18543](https://github.com/dotnet/fsharp/pull/18543)) * Scoped Nowarn: added the #warnon compiler directive ([Language suggestion #278](https://github.com/fsharp/fslang-suggestions/issues/278), [RFC FS-1146 PR](https://github.com/fsharp/fslang-design/pull/782), [PR #18049](https://github.com/dotnet/fsharp/pull/18049)) ### Fixed From 6ca06c55b9f3b1fbc4218bc147cef431a345ba0a Mon Sep 17 00:00:00 2001 From: edgargonzalez Date: Thu, 15 May 2025 21:48:17 +0100 Subject: [PATCH 18/19] update baselines --- ...verify_FSharp.Compiler.Service_Debug_net9.0.bsl | 10 +++++----- ...Sharp.Compiler.Service_Debug_netstandard2.0.bsl | 10 +++++----- ...rify_FSharp.Compiler.Service_Release_net9.0.bsl | 14 +++++++------- ...arp.Compiler.Service_Release_netstandard2.0.bsl | 10 +++++----- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl index 897dd2ac22a..625bad81a15 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_net9.0.bsl @@ -24,11 +24,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-805::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001E5][found Char] Unexpected type on the stack. [IL]: Error [UnmanagedPointer]: : FSharp.Compiler.Interactive.Shell+Utilities+pointerToNativeInt@106::Invoke(object)][offset 0x00000007] Unmanaged pointers are not a verifiable type. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+dataTipOfReferences@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000084][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::getCompilerOption([FSharp.Compiler.Service]FSharp.Compiler.CompilerOptions+CompilerOption, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000E6][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::AddPathMapping([FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, string)][offset 0x0000000B][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index e81c636f402..90f99f2c896 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -35,11 +35,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x00000059][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000DA][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1424-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000605][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2495-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CreateILModule+MainModuleBuilder::ConvertProductVersionToILVersionInfo(string)][offset 0x00000011][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index c2e86bb58bf..7a20b934eef 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl @@ -23,13 +23,13 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+MagicAssemblyResolution::ResolveAssemblyCore([FSharp.Compiler.Service]Internal.Utilities.Library.CompilationThreadToken, [FSharp.Compiler.Service]FSharp.Compiler.Text.Range, [FSharp.Compiler.Service]FSharp.Compiler.CompilerConfig+TcConfigBuilder, [FSharp.Compiler.Service]FSharp.Compiler.CompilerImports+TcImports, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler, [FSharp.Compiler.Service]FSharp.Compiler.Interactive.Shell+FsiConsoleOutput, string)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Interactive.Shell+clo@3494-849::Invoke([S.P.CoreLib]System.Tuple`3)][offset 0x000001C7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$FSharpCheckerResults+GetReferenceResolutionStructuredToolTipText@2225::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000076][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@291-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@291-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::getCompilerOption([FSharp.Compiler.Service]FSharp.Compiler.CompilerOptions+CompilerOption, [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1)][offset 0x000000A7][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CompilerOptions::parseOption@266(string)][offset 0x0000000B][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index b53d7c7ecc6..23e7b8c6edf 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -34,11 +34,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000BB][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1424-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000620][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2495-3::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000030][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack. From 5ca1e9922673a9019d8bd89ac193fb88877490fa Mon Sep 17 00:00:00 2001 From: edgargonzalez Date: Mon, 19 May 2025 19:29:15 +0100 Subject: [PATCH 19/19] update ILVerify tests --- ...fy_FSharp.Compiler.Service_Debug_netstandard2.0.bsl | 10 +++++----- ..._FSharp.Compiler.Service_Release_netstandard2.0.bsl | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl index 077663dca21..305e0a3c2c6 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Debug_netstandard2.0.bsl @@ -35,11 +35,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x00000059][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000DA][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1431-6::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000605][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000082][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000008B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-509::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000094][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2496-1::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000015][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.CreateILModule+MainModuleBuilder::ConvertProductVersionToILVersionInfo(string)][offset 0x00000011][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.StaticLinking+TypeForwarding::followTypeForwardForILTypeRef([FSharp.Compiler.Service]FSharp.Compiler.AbstractIL.IL+ILTypeRef)][offset 0x00000010][found Char] Unexpected type on the stack. diff --git a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl index fd0973324e5..a089298cdd8 100644 --- a/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl +++ b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_netstandard2.0.bsl @@ -34,11 +34,11 @@ [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseMemberFunctionAndValues@176::Invoke([FSharp.Compiler.Service]FSharp.Compiler.Symbols.FSharpMemberOrFunctionOrValue)][offset 0x0000002B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.AssemblyContent+traverseEntity@218::GenerateNext([S.P.CoreLib]System.Collections.Generic.IEnumerable`1&)][offset 0x000000BB][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.EditorServices.ParsedInput+visitor@1431-11::VisitExpr([FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, [FSharp.Compiler.Service]FSharp.Compiler.Syntax.SynExpr)][offset 0x00000620][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. -[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@922-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000032][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000003B][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000064][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x0000006D][found Char] Unexpected type on the stack. +[IL]: Error [StackUnexpected]: : .$ServiceLexing+clo@923-530::Invoke([FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,Microsoft.FSharp.Core.Unit>)][offset 0x00000076][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : .$Symbols+fullName@2496-3::Invoke([FSharp.Core]Microsoft.FSharp.Core.Unit)][offset 0x00000030][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x0000000B][found Char] Unexpected type on the stack. [IL]: Error [StackUnexpected]: : FSharp.Compiler.Driver+ProcessCommandLineFlags@286-1::Invoke(string)][offset 0x00000014][found Char] Unexpected type on the stack.