Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions src/Compiler/Checking/Expressions/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5961,7 +5961,6 @@ and TcExprUndelayed (cenv: cenv) (overallTy: OverallTy) env tpenv (synExpr: SynE

| SynExpr.InterpolatedString (parts, _, m) ->
TcNonControlFlowExpr env <| fun env ->
checkLanguageFeatureAndRecover g.langVersion LanguageFeature.StringInterpolation m
CallExprHasTypeSink cenv.tcSink (m, env.NameEnv, overallTy.Commit, env.AccessRights)
TcInterpolatedStringExpr cenv overallTy env m tpenv parts

Expand Down Expand Up @@ -7849,7 +7848,7 @@ and TcInterpolatedStringExpr cenv (overallTy: OverallTy) env m tpenv (parts: Syn
let newFormatMethod =
match GetIntrinsicConstructorInfosOfType cenv.infoReader m formatTy |> List.filter (fun minfo -> minfo.NumArgs = [3]) with
| [ctorInfo] -> ctorInfo
| _ -> languageFeatureNotSupportedInLibraryError LanguageFeature.StringInterpolation m
| _ -> error (Error(FSComp.SR.csMethodNotFound(RichText.mkMethod "Microsoft.FSharp.Core.PrintfFormat.ctor"), m))

let stringKind =
// If this is an interpolated string then try to force the result to be a string
Expand All @@ -7876,15 +7875,9 @@ and TcInterpolatedStringExpr cenv (overallTy: OverallTy) env m tpenv (parts: Syn
UnifyTypes cenv env m printerResultTy overallTy.Commit

// Find the FormattableStringFactor.Create method in the .NET libraries
let ad = env.eAccessRights
let createMethodOpt =
match TryFindIntrinsicOrExtensionMethInfo ResultCollectionSettings.AllResults cenv env m ad "Create" g.system_FormattableStringFactory_ty with
| [x] -> Some x
| _ -> None

match createMethodOpt with
| Some createMethod -> Choice2Of2 createMethod
| None -> languageFeatureNotSupportedInLibraryError LanguageFeature.StringInterpolation m
match TryFindIntrinsicOrExtensionMethInfo ResultCollectionSettings.AllResults cenv env m env.eAccessRights "Create" g.system_FormattableStringFactory_ty with
| [createMethod] -> Choice2Of2 createMethod
| _ -> error (Error(FSComp.SR.csMethodNotFound(RichText.mkMethod "System.Runtime.CompilerServices.FormattableStringFactory.Create"), m))

// ... or if that fails then may be a PrintfFormat by a type-directed rule....
elif not (isObjTyAnyNullness g overallTy.Commit) && AddCxTypeMustSubsumeTypeUndoIfFailed env.DisplayEnv cenv.css m overallTy.Commit formatTy then
Expand Down
4 changes: 1 addition & 3 deletions src/Compiler/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,6 @@ csTypeHasNullAsExtraValue,"The type '%s' supports 'null' but a non-null type is
3304,poundiNotSupportedByRegisteredDependencyManagers,"#i is not supported by the registered PackageManagers"
3343,tcRequireMergeSourcesOrBindN,"The 'let! ... and! ...' construct may only be used if the computation expression builder defines either a '%s' method or appropriate 'MergeSources' and 'Bind' methods"
3345,tcInvalidUseBangBindingNoAndBangs,"use! may not be combined with and!"
3349,chkFeatureNotSupportedInLibrary,"Feature '%s' requires the F# library for language version %s or greater."
3350,chkFeatureNotLanguageSupported,"Feature '%s' is not available in F# %s. Please use language version %s or greater."
3351,chkFeatureNotRuntimeSupported,"Feature '%s' is not supported by target runtime."
runtimeStaticAbstractInterfaceMembers,"static abstract interface members"
Expand All @@ -1556,7 +1555,6 @@ formatDashItem," - %s"
featureFromEndSlicing,"from-end slicing"
featureNullnessChecking,"nullness checking"
featureRuntimeAsync,"runtime async"
featureStringInterpolation,"string interpolation"
featureWitnessPassing,"witness passing for trait constraints in F# quotations"
featureReallyLongList,"list literals of any size"
featureErrorOnDeprecatedRequireQualifiedAccess,"give error on deprecated access of construct with RequireQualifiedAccess attribute"
Expand Down Expand Up @@ -1762,7 +1760,7 @@ featureErrorOnBitwiseOpsOnNonIntegralEnums,"Error when bitwise operators are use
featureOptimizeClosureIfNotInlined,"optimize a curried closure argument when its inlining fails"
featureRequireNamedArguments,"enforce named arguments at call sites of methods annotated with RequireNamedArgumentsAttribute"
3880,optsLangVersionOutOfSupport,"Language version '%s' is out of support. The last .NET SDK supporting it is available at https://dotnet.microsoft.com/en-us/download/dotnet/%s"
3881,optsUnrecognizedLanguageFeature,"Unrecognized language feature name: '%s'. Use a valid feature name such as 'StringInterpolation' or 'FromEndSlicing'."
3881,optsUnrecognizedLanguageFeature,"Unrecognized language feature name: '%s'. Use a valid feature name such as 'FromEndSlicing'."
3882,lexHashElifMustBeFirst,"#elif directive must appear as the first non-whitespace character on a line"
3883,lexHashElifMustHaveIdent,"#elif directive should be immediately followed by an identifier"
3884,tcFunctionValueUsedAsInterpolatedStringArg,"This expression is a function value. When used in an interpolated string it will be formatted using its 'ToString' method, which is likely not the intended behavior. Consider applying the function to its arguments."
Expand Down
5 changes: 0 additions & 5 deletions src/Compiler/Facilities/DiagnosticsLogger.fs
Original file line number Diff line number Diff line change
Expand Up @@ -896,11 +896,6 @@ let internal tryCheckLanguageFeatureAndRecover langVersion langFeature m =
let internal checkLanguageFeatureAndRecover langVersion langFeature m =
tryCheckLanguageFeatureAndRecover langVersion langFeature m |> ignore

let internal languageFeatureNotSupportedInLibraryError (langFeature: LanguageFeature) (m: range) =
let featureStr = LanguageVersion.GetFeatureString langFeature
let suggestedVersionStr = LanguageVersion.GetFeatureVersionString langFeature
error (Error(FSComp.SR.chkFeatureNotSupportedInLibrary (featureStr, suggestedVersionStr), m))

module StackGuardMetrics =

let meter = FSharp.Compiler.Diagnostics.Metrics.Meter
Expand Down
2 changes: 0 additions & 2 deletions src/Compiler/Facilities/DiagnosticsLogger.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,6 @@ val checkLanguageFeatureAndRecover: langVersion: LanguageVersion -> langFeature:
val tryLanguageFeatureErrorOption:
langVersion: LanguageVersion -> langFeature: LanguageFeature -> m: range -> exn option

val languageFeatureNotSupportedInLibraryError: langFeature: LanguageFeature -> m: range -> 'T

module internal StackGuardMetrics =
val Listen: unit -> IDisposable
val StatsToString: unit -> string
Expand Down
3 changes: 0 additions & 3 deletions src/Compiler/Facilities/LanguageFeatures.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ type LanguageFeature =
| FromEndSlicing
| RuntimeAsync
| WitnessPassing
| StringInterpolation
| ExpandedMeasurables
| NullnessChecking
| UnionIsPropertiesVisible
Expand Down Expand Up @@ -120,7 +119,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array)
[
// F# 5.0
LanguageFeature.WitnessPassing, languageVersion50
LanguageFeature.StringInterpolation, languageVersion50

// F# 6.0
LanguageFeature.ExpandedMeasurables, languageVersion60
Expand Down Expand Up @@ -292,7 +290,6 @@ type LanguageVersion(versionText, ?disabledFeaturesArray: LanguageFeature array)
| LanguageFeature.NullnessChecking -> FSComp.SR.featureNullnessChecking ()
| LanguageFeature.RuntimeAsync -> FSComp.SR.featureRuntimeAsync ()
| LanguageFeature.WitnessPassing -> FSComp.SR.featureWitnessPassing ()
| LanguageFeature.StringInterpolation -> FSComp.SR.featureStringInterpolation ()
| LanguageFeature.ExpandedMeasurables -> FSComp.SR.featureExpandedMeasurables ()
| LanguageFeature.UnionIsPropertiesVisible -> FSComp.SR.featureUnionIsPropertiesVisible ()
| LanguageFeature.AttributesToRightOfModuleKeyword -> FSComp.SR.featureAttributesToRightOfModuleKeyword ()
Expand Down
1 change: 0 additions & 1 deletion src/Compiler/Facilities/LanguageFeatures.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ type LanguageFeature =
| FromEndSlicing
| RuntimeAsync
| WitnessPassing
| StringInterpolation
| ExpandedMeasurables
| NullnessChecking
| UnionIsPropertiesVisible
Expand Down
14 changes: 2 additions & 12 deletions src/Compiler/xlf/FSComp.txt.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 2 additions & 12 deletions src/Compiler/xlf/FSComp.txt.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 2 additions & 12 deletions src/Compiler/xlf/FSComp.txt.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 2 additions & 12 deletions src/Compiler/xlf/FSComp.txt.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 2 additions & 12 deletions src/Compiler/xlf/FSComp.txt.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading