From 19a905b97926336027a3983e3528354d8434660b Mon Sep 17 00:00:00 2001 From: Copilot Date: Wed, 2 Sep 2026 14:13:26 +0200 Subject: [PATCH] Remove always-on ExtendedStringInterpolation language feature flag Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/Compiler/FSComp.txt | 2 -- src/Compiler/Facilities/LanguageFeatures.fs | 3 --- src/Compiler/Facilities/LanguageFeatures.fsi | 1 - src/Compiler/lex.fsl | 24 +++++++------------- src/Compiler/xlf/FSComp.txt.cs.xlf | 10 -------- src/Compiler/xlf/FSComp.txt.de.xlf | 10 -------- src/Compiler/xlf/FSComp.txt.es.xlf | 10 -------- src/Compiler/xlf/FSComp.txt.fr.xlf | 10 -------- src/Compiler/xlf/FSComp.txt.it.xlf | 10 -------- src/Compiler/xlf/FSComp.txt.ja.xlf | 10 -------- src/Compiler/xlf/FSComp.txt.ko.xlf | 10 -------- src/Compiler/xlf/FSComp.txt.pl.xlf | 10 -------- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 10 -------- src/Compiler/xlf/FSComp.txt.ru.xlf | 10 -------- src/Compiler/xlf/FSComp.txt.tr.xlf | 10 -------- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 10 -------- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 10 -------- 17 files changed, 8 insertions(+), 152 deletions(-) diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 549a12b8d9b..c500c23b92f 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1129,7 +1129,6 @@ parsNonAtomicType,"The use of the type syntax 'int C' and 'C ' is not perm 1248,lexTooManyLBracesInTripleQuote,"The interpolated triple quoted string literal does not start with enough '$' characters to allow this many consecutive opening braces as content." 1249,lexUnmatchedRBracesInTripleQuote,"The interpolated string contains unmatched closing braces." 1250,lexTooManyPercentsInTripleQuote,"The interpolated triple quoted string literal does not start with enough '$' characters to allow this many consecutive '%%' characters." -1251,lexExtendedStringInterpolationNotSupported,"Extended string interpolation is not supported in this version of F#." 1252,lexInvalidCharLiteralInString,"'%s' is not a valid character literal.\nNote: Currently the value is wrapped around byte range to '%s'. In a future F# version this warning will be promoted to an error." 1253,lexByteArrayOutisdeAscii,"This byte array literal contains %d non-ASCII characters. All characters should be < 128y." # reshapedmsbuild.fs @@ -1579,7 +1578,6 @@ featureArithmeticInLiterals,"Arithmetic and logical operations in literals, enum featureErrorReportingOnStaticClasses,"Error reporting on static classes" featureWarningWhenCopyAndUpdateRecordChangesAllFields,"Raises warnings when an copy-and-update record expression changes all fields of a record." featureNonInlineLiteralsAsPrintfFormat,"String values marked as literals and IL constants as printf format" -featureExtendedStringInterpolation,"Extended string interpolation similar to C# raw string literals." featureWarningWhenMultipleRecdTypeChoice,"Raises warnings when multiple record type matches were found during name resolution because of overlapping field names." featureConstraintIntersectionOnFlexibleTypes,"Constraint intersection on flexible types" featureChkNotTailRecursive,"Raises warnings if a member or function has the 'TailCall' attribute, but is not being used in a tail recursive way." diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 83838898397..df2611b5c03 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -43,7 +43,6 @@ type LanguageFeature = | ErrorReportingOnStaticClasses | WarningWhenCopyAndUpdateRecordChangesAllFields | NonInlineLiteralsAsPrintfFormat - | ExtendedStringInterpolation | WarningWhenMultipleRecdTypeChoice | ConstraintIntersectionOnFlexibleTypes | StaticLetInRecordsDusEmptyTypes @@ -159,7 +158,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) LanguageFeature.ErrorReportingOnStaticClasses, languageVersion80 LanguageFeature.WarningWhenCopyAndUpdateRecordChangesAllFields, languageVersion80 LanguageFeature.NonInlineLiteralsAsPrintfFormat, languageVersion80 - LanguageFeature.ExtendedStringInterpolation, languageVersion80 LanguageFeature.WarningWhenMultipleRecdTypeChoice, languageVersion80 LanguageFeature.WarningWhenTailRecAttributeButNonTailRecUsage, languageVersion80 LanguageFeature.StaticLetInRecordsDusEmptyTypes, languageVersion80 @@ -340,7 +338,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array) | LanguageFeature.WarningWhenCopyAndUpdateRecordChangesAllFields -> FSComp.SR.featureWarningWhenCopyAndUpdateRecordChangesAllFields () | LanguageFeature.NonInlineLiteralsAsPrintfFormat -> FSComp.SR.featureNonInlineLiteralsAsPrintfFormat () - | LanguageFeature.ExtendedStringInterpolation -> FSComp.SR.featureExtendedStringInterpolation () | LanguageFeature.WarningWhenMultipleRecdTypeChoice -> FSComp.SR.featureWarningWhenMultipleRecdTypeChoice () | LanguageFeature.StaticLetInRecordsDusEmptyTypes -> FSComp.SR.featureStaticLetInRecordsDusEmptyTypes () | LanguageFeature.ConstraintIntersectionOnFlexibleTypes -> FSComp.SR.featureConstraintIntersectionOnFlexibleTypes () diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index 1073b35d34d..fd959481ef4 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -33,7 +33,6 @@ type LanguageFeature = | ErrorReportingOnStaticClasses | WarningWhenCopyAndUpdateRecordChangesAllFields | NonInlineLiteralsAsPrintfFormat - | ExtendedStringInterpolation | WarningWhenMultipleRecdTypeChoice | ConstraintIntersectionOnFlexibleTypes | StaticLetInRecordsDusEmptyTypes diff --git a/src/Compiler/lex.fsl b/src/Compiler/lex.fsl index ebd8ab27ca1..9f2a49a51b5 100644 --- a/src/Compiler/lex.fsl +++ b/src/Compiler/lex.fsl @@ -620,24 +620,16 @@ rule token (args: LexArgs) (skip: bool) = parse | ('$'+) '"' '"' '"' { let buf, fin, m = startString args lexbuf - if lexbuf.SupportsFeature LanguageFeature.ExtendedStringInterpolation then - // Single quote in triple quote ok, others disallowed - match args.stringNest with - | _ :: _ -> errorR(Error(FSComp.SR.lexTripleQuoteInTripleQuote(), m)) - | [] -> () + // Single quote in triple quote ok, others disallowed + match args.stringNest with + | _ :: _ -> errorR(Error(FSComp.SR.lexTripleQuoteInTripleQuote(), m)) + | [] -> () - args.interpolationDelimiterLength <- lexeme lexbuf |> Seq.takeWhile (fun c -> c = '$') |> Seq.length - if not skip then - STRING_TEXT (LexCont.String(args.ifdefStack, args.stringNest, LexerStringStyle.ExtendedInterpolated, LexerStringKind.InterpolatedStringFirst, args.interpolationDelimiterLength, m)) - else - extendedInterpolatedString (buf, fin, m, LexerStringKind.InterpolatedStringFirst, args) skip lexbuf + args.interpolationDelimiterLength <- lexeme lexbuf |> Seq.takeWhile (fun c -> c = '$') |> Seq.length + if not skip then + STRING_TEXT (LexCont.String(args.ifdefStack, args.stringNest, LexerStringStyle.ExtendedInterpolated, LexerStringKind.InterpolatedStringFirst, args.interpolationDelimiterLength, m)) else - let result = - if not skip then - STRING_TEXT (LexCont.String(args.ifdefStack, args.stringNest, LexerStringStyle.TripleQuote, LexerStringKind.InterpolatedStringFirst, args.interpolationDelimiterLength, m)) - else - tripleQuoteString (buf, fin, m, LexerStringKind.InterpolatedStringFirst, args) skip lexbuf - fail args lexbuf (FSComp.SR.lexExtendedStringInterpolationNotSupported()) result + extendedInterpolatedString (buf, fin, m, LexerStringKind.InterpolatedStringFirst, args) skip lexbuf } | '$' '"' diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 325b343e8ed..a36bbc3c30e 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -432,11 +432,6 @@ rozšířené pevné vazby pro byref a GetPinnableReference - - Extended string interpolation similar to C# raw string literals. - Rozšířená interpolace řetězců podobná nezpracovaným řetězcovým literálům jazyka C#. - - Allow extension members to participate in SRTP constraint resolution Allow extension members to participate in SRTP constraint resolution @@ -782,11 +777,6 @@ #: directives must start at the beginning of a line - - Extended string interpolation is not supported in this version of F#. - Rozšířená interpolace řetězců není v této verzi jazyka F# podporována. - - #elif is not allowed after #else #elif is not allowed after #else diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 611da253f4f..3064051c8de 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -432,11 +432,6 @@ Erweiterte feste Bindungen für byref und GetPinnableReference - - Extended string interpolation similar to C# raw string literals. - Erweiterte Zeichenfolgeninterpolation ähnlich wie bei C#-Rohzeichenfolgenliteralen. - - Allow extension members to participate in SRTP constraint resolution Allow extension members to participate in SRTP constraint resolution @@ -782,11 +777,6 @@ #: directives must start at the beginning of a line - - Extended string interpolation is not supported in this version of F#. - Die erweiterte Zeichenfolgeninterpolation wird in dieser Version von F# nicht unterstützt. - - #elif is not allowed after #else #elif is not allowed after #else diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index fc24eae75ba..26164cdd3c6 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -432,11 +432,6 @@ enlaces fijos extendidos para byref y GetPinnableReference - - Extended string interpolation similar to C# raw string literals. - Interpolación de cadena extendida similar a los literales de cadena sin formato de C#. - - Allow extension members to participate in SRTP constraint resolution Allow extension members to participate in SRTP constraint resolution @@ -782,11 +777,6 @@ #: directives must start at the beginning of a line - - Extended string interpolation is not supported in this version of F#. - No se admite la interpolación de cadenas extendida en esta versión de F#. - - #elif is not allowed after #else #elif is not allowed after #else diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index 820c71101de..bdbc04d430d 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -432,11 +432,6 @@ liaisons fixes étendues pour byref et GetPinnableReference - - Extended string interpolation similar to C# raw string literals. - Interpolation de chaîne étendue similaire aux littéraux de chaîne brute C#. - - Allow extension members to participate in SRTP constraint resolution Allow extension members to participate in SRTP constraint resolution @@ -782,11 +777,6 @@ #: directives must start at the beginning of a line - - Extended string interpolation is not supported in this version of F#. - L'interpolation de chaîne étendue n'est pas prise en charge dans cette version de F#. - - #elif is not allowed after #else #elif is not allowed after #else diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 6b260c73a74..f69a6dd9e7d 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -432,11 +432,6 @@ binding fissi estesi per byref e GetPinnableReference - - Extended string interpolation similar to C# raw string literals. - Interpolazione di stringa estesa simile ai valori letterali stringa non elaborati C#. - - Allow extension members to participate in SRTP constraint resolution Allow extension members to participate in SRTP constraint resolution @@ -782,11 +777,6 @@ #: directives must start at the beginning of a line - - Extended string interpolation is not supported in this version of F#. - L'interpolazione di stringa estesa non è supportata in questa versione di F#. - - #elif is not allowed after #else #elif is not allowed after #else diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index cf52089e5cd..3f01b8727d9 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -432,11 +432,6 @@ byref と GetPinnableReference の拡張固定バインド - - Extended string interpolation similar to C# raw string literals. - C# の生文字列リテラルに似た拡張文字列補間。 - - Allow extension members to participate in SRTP constraint resolution Allow extension members to participate in SRTP constraint resolution @@ -782,11 +777,6 @@ #: directives must start at the beginning of a line - - Extended string interpolation is not supported in this version of F#. - 拡張文字列補間は、このバージョンの F# ではサポートされていません。 - - #elif is not allowed after #else #elif is not allowed after #else diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index dc41bf764ad..6908c891be2 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -432,11 +432,6 @@ byref 및 GetPinnableReference에 대한 확장된 고정 바인딩 - - Extended string interpolation similar to C# raw string literals. - C# 원시 문자열 리터럴과 유사한 확장 문자열 보간입니다. - - Allow extension members to participate in SRTP constraint resolution Allow extension members to participate in SRTP constraint resolution @@ -782,11 +777,6 @@ #: directives must start at the beginning of a line - - Extended string interpolation is not supported in this version of F#. - 확장 문자열 보간은 이 버전의 F#에서 지원되지 않습니다. - - #elif is not allowed after #else #elif is not allowed after #else diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index b38ca63ae66..5cb057b2e36 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -432,11 +432,6 @@ rozszerzone powiązania stałe dla elementów byref i GetPinnableReference - - Extended string interpolation similar to C# raw string literals. - Rozszerzona interpolacja ciągów podobna do literałów nieprzetworzonych ciągów języka C#. - - Allow extension members to participate in SRTP constraint resolution Allow extension members to participate in SRTP constraint resolution @@ -782,11 +777,6 @@ #: directives must start at the beginning of a line - - Extended string interpolation is not supported in this version of F#. - Rozszerzona interpolacja ciągów nie jest obsługiwana w tej wersji języka F#. - - #elif is not allowed after #else #elif is not allowed after #else diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 6e1d8605335..6578fdc7258 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -432,11 +432,6 @@ associações fixas estendidas para byref e GetPinnableReference - - Extended string interpolation similar to C# raw string literals. - Interpolação de cadeia de caracteres estendida semelhante a literais de cadeia de caracteres bruta C#. - - Allow extension members to participate in SRTP constraint resolution Allow extension members to participate in SRTP constraint resolution @@ -782,11 +777,6 @@ #: directives must start at the beginning of a line - - Extended string interpolation is not supported in this version of F#. - Não há suporte para interpolação de cadeia de caracteres estendida nesta versão do F#. - - #elif is not allowed after #else #elif is not allowed after #else diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 5cfd420f2e5..3356e5b7aad 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -432,11 +432,6 @@ расширенные фиксированные привязки для byref и GetPinnableReference - - Extended string interpolation similar to C# raw string literals. - Расширенная интерполяция строк, аналогичная литералам необработанных строк C#. - - Allow extension members to participate in SRTP constraint resolution Allow extension members to participate in SRTP constraint resolution @@ -782,11 +777,6 @@ #: directives must start at the beginning of a line - - Extended string interpolation is not supported in this version of F#. - Расширенная интерполяция строк не поддерживается в этой версии F#. - - #elif is not allowed after #else #elif is not allowed after #else diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index dfb77dff307..5fb1665e85f 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -432,11 +432,6 @@ byref ve GetPinnableReference için genişletilmiş sabit bağlamalar - - Extended string interpolation similar to C# raw string literals. - C# ham sabit değerli dizeye benzer genişletilmiş dize ilişkilendirmesi. - - Allow extension members to participate in SRTP constraint resolution Allow extension members to participate in SRTP constraint resolution @@ -782,11 +777,6 @@ #: directives must start at the beginning of a line - - Extended string interpolation is not supported in this version of F#. - Genişletilmiş dize ilişkilendirmesi bu F# sürümünde desteklenmiyor. - - #elif is not allowed after #else #elif is not allowed after #else diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 9cfe459b1e5..a3b5542e720 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -432,11 +432,6 @@ byref 和 GetPinnableReference 的扩展固定绑定 - - Extended string interpolation similar to C# raw string literals. - 扩展字符串内插类似于 C# 原始字符串字面量。 - - Allow extension members to participate in SRTP constraint resolution Allow extension members to participate in SRTP constraint resolution @@ -782,11 +777,6 @@ #: directives must start at the beginning of a line - - Extended string interpolation is not supported in this version of F#. - 此版本的 F# 不支持扩展字符串内插。 - - #elif is not allowed after #else #elif is not allowed after #else diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 5f31aa82294..22fa63ee304 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -432,11 +432,6 @@ ByRef 和 GetPinnableReference 的擴充固定繫結 - - Extended string interpolation similar to C# raw string literals. - 類似於 C# 原始字串常值的擴充字串插補。 - - Allow extension members to participate in SRTP constraint resolution Allow extension members to participate in SRTP constraint resolution @@ -782,11 +777,6 @@ #: directives must start at the beginning of a line - - Extended string interpolation is not supported in this version of F#. - 此 F# 版本不支援擴充字串插補。 - - #elif is not allowed after #else #elif is not allowed after #else