diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md index 841e49c4c31..067a9d56800 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -1,4 +1,6 @@ ### Fixed + +* Fix parsing errors using anonymous records and units of measures ([PR #18543](https://github.com/dotnet/fsharp/pull/18543)) * Fixed: Allow `return`, `return!`, `yield`, `yield!` type annotations without parentheses ([PR #18533](https://github.com/dotnet/fsharp/pull/18533)) * Allow `let!` and `use!` type annotations without requiring parentheses ([PR #18508](https://github.com/dotnet/fsharp/pull/18508)) * Fix find all references for F# exceptions ([PR #18565](https://github.com/dotnet/fsharp/pull/18565)) 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 6999094ccb3..a5341551395 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)) * Fixed: Allow `return`, `return!`, `yield`, `yield!` type annotations without parentheses ([PR #18533](https://github.com/dotnet/fsharp/pull/18533)) diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index 40775e8dfa6..687402597c5 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)) * Allow `let!` and `use!` type annotations without requiring parentheses. ([PR #18508](https://github.com/dotnet/fsharp/pull/18508)) diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index 2bdb5fe6923..5f96b1f58c8 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -1141,6 +1141,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") diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 1d7e9d6499a..969b40ae4ff 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" featureAllowLetOrUseBangTypeAnnotationWithoutParens,"Allow let! and use! type annotations without requiring parentheses" 3874,lexWarnDirectiveMustBeFirst,"#nowarn/#warnon directives must appear as the first non-whitespace characters on a line" 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/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index fd0f646531b..246ec741d67 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -100,6 +100,7 @@ type LanguageFeature = | SupportValueOptionsAsOptionalParameters | WarnWhenUnitPassedToObjArg | UseBangBindingValueDiscard + | BetterAnonymousRecordParsing | ScopedNowarn | AllowTypedLetOrUseBang @@ -233,6 +234,7 @@ type LanguageVersion(versionText) = LanguageFeature.SupportValueOptionsAsOptionalParameters, previewVersion LanguageFeature.WarnWhenUnitPassedToObjArg, previewVersion LanguageFeature.UseBangBindingValueDiscard, previewVersion + LanguageFeature.BetterAnonymousRecordParsing, previewVersion LanguageFeature.ScopedNowarn, previewVersion LanguageFeature.AllowTypedLetOrUseBang, previewVersion ] @@ -398,6 +400,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 () | LanguageFeature.AllowTypedLetOrUseBang -> FSComp.SR.featureAllowLetOrUseBangTypeAnnotationWithoutParens () diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index 95bd956e0b7..c9e70ce1567 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -91,6 +91,7 @@ type LanguageFeature = | SupportValueOptionsAsOptionalParameters | WarnWhenUnitPassedToObjArg | UseBangBindingValueDiscard + | BetterAnonymousRecordParsing | ScopedNowarn | AllowTypedLetOrUseBang diff --git a/src/Compiler/Service/ServiceLexing.fs b/src/Compiler/Service/ServiceLexing.fs index bc07224d70b..fb2af965f76 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 _ @@ -1387,6 +1388,7 @@ type FSharpTokenKind = | Comma | RightArrow | GreaterBarRightBracket + | GreaterBarRightBrace | LeftParenthesisStarRightParenthesis | Open | Or @@ -1598,6 +1600,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 261c7c6764e..1efcf59269d 100755 --- a/src/Compiler/Service/ServiceLexing.fsi +++ b/src/Compiler/Service/ServiceLexing.fsi @@ -457,6 +457,7 @@ type public FSharpTokenKind = | Comma | RightArrow | GreaterBarRightBracket + | GreaterBarRightBrace | LeftParenthesisStarRightParenthesis | Open | Or diff --git a/src/Compiler/SyntaxTree/LexFilter.fs b/src/Compiler/SyntaxTree/LexFilter.fs index 20af46524b0..a97fb94d5e4 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,11 @@ 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 -> + 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 | GREATER_BAR_RBRACK -> delayToken (pool.UseShiftedLocation(tokenTup, BAR_RBRACK, 1, 0)) delayToken (pool.UseShiftedLocation(tokenTup, GREATER res, 0, -2)) diff --git a/src/Compiler/lex.fsl b/src/Compiler/lex.fsl index 2d52ec029f7..9abb9408c9e 100644 --- a/src/Compiler/lex.fsl +++ b/src/Compiler/lex.fsl @@ -905,6 +905,8 @@ rule token (args: LexArgs) (skip: bool) = parse | ">" { GREATER false } + | ">|}" { GREATER_BAR_RBRACE } + | "[<" { LBRACK_LESS } | "]" { RBRACK } diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index bbfca699064..285a8a0c47e 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 diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index caa825a8245..15516bde9f4 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -312,6 +312,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 2d193f09a0e..98203615481 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -312,6 +312,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 1e0f79d0124..f9a01cc8009 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -312,6 +312,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 71a14ff33f0..904ce2c3c69 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -312,6 +312,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 12f56c30e93..ea9f636b455 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -312,6 +312,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 d84ecad7170..073d2bc0127 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -312,6 +312,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 39c3a728b37..ac3e6c95d94 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -312,6 +312,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 e5f2bda5529..450bc59ad22 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -312,6 +312,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 c69f534b10e..8eb539fa237 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -312,6 +312,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 ca41d4affcc..27d646c8a9c 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -312,6 +312,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 17a75ffa27c..ee7db390d59 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -312,6 +312,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 155480c6314..0ca3574bbb9 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -312,6 +312,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 3c96310c8a7..42aa912d17c 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -312,6 +312,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/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 插補字串 diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs index 354539ed7c1..ef0b307853a 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Types/RecordTypes/AnonymousRecords.fs @@ -19,6 +19,138 @@ 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 + |> 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 + + [] + 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 + |> 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 + + [] + 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 + |> 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 + + [] + 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 + |> 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 [] let ``Anonymous Record missing single field`` () = 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 index bb0389f5021..e2349c44c11 100644 --- 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 @@ -11288,6 +11288,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 @@ -11484,6 +11485,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 @@ -11676,6 +11678,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() @@ -11868,6 +11871,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 @@ -12060,6 +12064,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 index bb0389f5021..e2349c44c11 100644 --- 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 @@ -11288,6 +11288,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 @@ -11484,6 +11485,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 @@ -11676,6 +11678,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() @@ -11868,6 +11871,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 @@ -12060,6 +12064,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/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 5475f43bdc1..2e1d5680e1d 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_net9.0.bsl b/tests/ILVerify/ilverify_FSharp.Compiler.Service_Release_net9.0.bsl index 9821dc3dc1a..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,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@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]: : .$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. 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 7a78ab1999a..b8f7bba8f5f 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. 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..a8ff99d1b82 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-07.fs.bsl @@ -0,0 +1,55 @@ +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 = [] + WarnDirectives = [] + 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..ed640191c59 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-08.fs.bsl @@ -0,0 +1,83 @@ +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 = [] + WarnDirectives = [] + CodeComments = [] }, set [])) 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..ec7c2e4e312 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-09.fs.bsl @@ -0,0 +1,47 @@ +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 = [] + WarnDirectives = [] + 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..a30127b522f --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-10.fs.bsl @@ -0,0 +1,55 @@ +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 = [] + WarnDirectives = [] + 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..180ed425c9e --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-11.fs.bsl @@ -0,0 +1,127 @@ +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 = [] + WarnDirectives = [] + 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..1de6c8767d2 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-12.fs.bsl @@ -0,0 +1,47 @@ +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 = [] + WarnDirectives = [] + 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..93fd93c0088 --- /dev/null +++ b/tests/service/data/SyntaxTree/Expression/AnonymousRecords-13.fs.bsl @@ -0,0 +1,45 @@ +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 = [] + WarnDirectives = [] + 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 '{|'