From 924d799128b8cece36e984931fe8da9879cba0ca Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Fri, 13 Sep 2024 06:18:54 -0700 Subject: [PATCH 1/4] fix --- src/Compiler/Driver/CompilerDiagnostics.fs | 8 +-- .../CompilerDirectives/Nowarn.fs | 58 +++++++++++-------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index c73b8e5d197..dbf4cbb4e1d 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -2304,8 +2304,8 @@ type DiagnosticsLoggerFilteringByScopedPragmas (langVersion: LanguageVersion, scopedPragmas, diagnosticOptions: FSharpDiagnosticOptions, diagnosticsLogger: DiagnosticsLogger) = inherit DiagnosticsLogger("DiagnosticsLoggerFilteringByScopedPragmas") - let needCompatibilityWithEarlierInconsistentInteraction = - not (langVersion.SupportsFeature LanguageFeature.ConsistentNowarnLineDirectiveInteraction) + let skipFilenameChecks = + not(langVersion.SupportsFeature LanguageFeature.ConsistentNowarnLineDirectiveInteraction) let mutable realErrorPresent = false @@ -2322,8 +2322,8 @@ type DiagnosticsLoggerFilteringByScopedPragmas scopedPragmas |> List.exists (fun (ScopedPragma.WarningOff(pragmaRange, warningNumFromPragma)) -> warningNum = warningNumFromPragma - && (needCompatibilityWithEarlierInconsistentInteraction - || m.FileIndex = pragmaRange.FileIndex && posGeq m.Start pragmaRange.Start)) + && (skipFilenameChecks || m.FileIndex = pragmaRange.FileIndex) + && posGeq m.Start pragmaRange.Start) |> not | None -> true diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs index 78067aa8c32..d8f12008774 100644 --- a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs +++ b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs @@ -8,44 +8,54 @@ module Nowarn = let warn20Text = "The result of this expression has type 'string' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'." - let checkFileBugSource = """ + [] + [] + [] + let ``line after nowarn - should warn`` (langVersion) = + + FSharp """ module A #nowarn "20" #line 1 "xyz.fs" -"" +"" // Warning disabled by # nowarn """ + |> withLangVersion langVersion + |> compile + |> shouldFail + |> withDiagnostics [ + (Warning 20, Line 1, Col 1, Line 1, Col 3, warn20Text) + ] + + [] + [] + [] + let ``line before nowarn - should succeed`` (langVersion) = - let checkFileBugSource2 = """ + FSharp """ module A #line 1 "xyz.fs" #nowarn "20" -"" +"" // Warning disabled by # nowarn """ - - - [] - let ``checkFile bug simulation for compatibility`` () = - - FSharp checkFileBugSource - |> withLangVersion80 + |> withLangVersion langVersion |> compile |> shouldSucceed - [] - let ``checkFile bug fixed leads to new warning`` () = - FSharp checkFileBugSource - |> withLangVersion90 + [] + [] + [] + let ``NoWarn compat nowarn without line`` (langVersion) = + + FSharp """ +module A +"" // Should produce an error +# nowarn "20" +"" // Warning disabled by # nowarn + """ + |> withLangVersion langVersion |> compile |> shouldFail |> withDiagnostics [ - (Warning 20, Line 1, Col 1, Line 1, Col 3, warn20Text) + (Warning 20, Line 3, Col 1, Line 3, Col 3, warn20Text) ] - - [] - let ``checkFile bug fixed, no warning if nowarn is correctly used`` () = - - FSharp checkFileBugSource2 - |> withLangVersion90 - |> compile - |> shouldSucceed From 9f141fea8f9d27d8e471873bde08a64dc6fc05ea Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Fri, 13 Sep 2024 08:27:38 -0700 Subject: [PATCH 2/4] temp --- src/Compiler/Driver/CompilerDiagnostics.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index dbf4cbb4e1d..f3e2961851e 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -2305,7 +2305,7 @@ type DiagnosticsLoggerFilteringByScopedPragmas inherit DiagnosticsLogger("DiagnosticsLoggerFilteringByScopedPragmas") let skipFilenameChecks = - not(langVersion.SupportsFeature LanguageFeature.ConsistentNowarnLineDirectiveInteraction) + not(true || langVersion.SupportsFeature LanguageFeature.ConsistentNowarnLineDirectiveInteraction) let mutable realErrorPresent = false From da8df1fd11ab6bf2a6ebc72bdb6b501fbe309023 Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Fri, 13 Sep 2024 08:39:38 -0700 Subject: [PATCH 3/4] revert --- buildtools/fsyacc/fsyaccdriver.fs | 2 - .../.FSharp.Compiler.Service/9.0.100.md | 1 - docs/release-notes/.Language/preview.md | 6 ++ src/Compiler/AbstractIL/ilpars.fsy | 1 - src/Compiler/Driver/CompilerDiagnostics.fs | 23 ++++--- src/Compiler/Driver/CompilerDiagnostics.fsi | 3 +- src/Compiler/Driver/ParseAndCheckInputs.fs | 4 +- src/Compiler/Driver/fsc.fs | 2 +- src/Compiler/FSComp.txt | 3 +- src/Compiler/Facilities/LanguageFeatures.fs | 3 - src/Compiler/Facilities/LanguageFeatures.fsi | 1 - src/Compiler/Service/IncrementalBuild.fs | 2 +- src/Compiler/Service/TransparentCompiler.fs | 7 +-- src/Compiler/pars.fsy | 1 - src/Compiler/pppars.fsy | 1 - src/Compiler/xlf/FSComp.txt.cs.xlf | 5 -- src/Compiler/xlf/FSComp.txt.de.xlf | 5 -- src/Compiler/xlf/FSComp.txt.es.xlf | 5 -- src/Compiler/xlf/FSComp.txt.fr.xlf | 5 -- src/Compiler/xlf/FSComp.txt.it.xlf | 5 -- src/Compiler/xlf/FSComp.txt.ja.xlf | 5 -- src/Compiler/xlf/FSComp.txt.ko.xlf | 5 -- src/Compiler/xlf/FSComp.txt.pl.xlf | 5 -- src/Compiler/xlf/FSComp.txt.pt-BR.xlf | 5 -- src/Compiler/xlf/FSComp.txt.ru.xlf | 5 -- src/Compiler/xlf/FSComp.txt.tr.xlf | 5 -- src/Compiler/xlf/FSComp.txt.zh-Hans.xlf | 5 -- src/Compiler/xlf/FSComp.txt.zh-Hant.xlf | 5 -- .../CompilerDirectives/Nowarn.fs | 61 ------------------- .../FSharp.Compiler.ComponentTests.fsproj | 1 - 30 files changed, 27 insertions(+), 160 deletions(-) delete mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs diff --git a/buildtools/fsyacc/fsyaccdriver.fs b/buildtools/fsyacc/fsyaccdriver.fs index f46e607f93a..c9ca12e4710 100644 --- a/buildtools/fsyacc/fsyaccdriver.fs +++ b/buildtools/fsyacc/fsyaccdriver.fs @@ -199,8 +199,6 @@ let writeSpecToFile (generatorState: GeneratorState) (spec: ParserSpec) (compile writer.WriteLineInterface "module %s" s; writer.WriteLine "#nowarn \"64\";; // turn off warnings that type variables used in production annotations are instantiated to concrete type"; - writer.WriteLine "#nowarn \"1182\" // the generated code often has unused variable 'parseState'" - writer.WriteLine "#nowarn \"3261\" // the generated code would need to properly annotate nulls, e.g. changing System.Object to `obj|null`"; for s in generatorState.opens do writer.WriteLine "open %s" s; diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md index 24ce8c5a07b..e4d4ed4b96b 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.100.md @@ -1,6 +1,5 @@ ### Fixed -* Fix a bug in the interaction between ``#line` and `#nowarn` directives ([PR #17649](https://github.com/dotnet/fsharp/pull/17649)) * Fix wrong TailCall warning ([Issue #17604](https://github.com/dotnet/fsharp/issues/17604), [PR #17637](https://github.com/dotnet/fsharp/pull/17637)) * Compiler hangs when compiling inline recursive invocation ([Issue #17376](https://github.com/dotnet/fsharp/issues/17376), [PR #17394](https://github.com/dotnet/fsharp/pull/17394)) * Fix reporting IsFromComputationExpression only for CE builder type constructors and let bindings. ([PR #17375](https://github.com/dotnet/fsharp/pull/17375)) diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index b18d08e30c3..a3cb97fbdd4 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -4,4 +4,10 @@ ### Fixed +* Allow extension methods without type attribute work for types from imported assemblies. ([PR #16368](https://github.com/dotnet/fsharp/pull/16368)) +* Enforce AttributeTargets on let values and functions. ([PR #16692](https://github.com/dotnet/fsharp/pull/16692)) +* Enforce AttributeTargets on union case declarations. ([PR #16764](https://github.com/dotnet/fsharp/pull/16764)) +* Enforce AttributeTargets on implicit constructors. ([PR #16845](https://github.com/dotnet/fsharp/pull/16845/)) +* Enforce AttributeTargets on structs and classes ([PR #16790](https://github.com/dotnet/fsharp/pull/16790)) + ### Changed diff --git a/src/Compiler/AbstractIL/ilpars.fsy b/src/Compiler/AbstractIL/ilpars.fsy index b8380364f6b..ca06f6570be 100644 --- a/src/Compiler/AbstractIL/ilpars.fsy +++ b/src/Compiler/AbstractIL/ilpars.fsy @@ -2,7 +2,6 @@ %{ -#nowarn "64" // turn off warnings that type variables used in production annotations are instantiated to concrete type #nowarn "1182" // the generated code often has unused variable "parseState" #nowarn "3261" // the generated code would need to properly annotate nulls, e.g. changing System.Object to `obj|null` diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs index f3e2961851e..1c50ca26781 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fs +++ b/src/Compiler/Driver/CompilerDiagnostics.fs @@ -24,7 +24,6 @@ open FSharp.Compiler.ConstraintSolver open FSharp.Compiler.DiagnosticMessage open FSharp.Compiler.Diagnostics open FSharp.Compiler.DiagnosticsLogger -open FSharp.Compiler.Features open FSharp.Compiler.Infos open FSharp.Compiler.IO open FSharp.Compiler.Lexhelp @@ -2300,13 +2299,17 @@ type PhasedDiagnostic with // Scoped #nowarn pragmas /// Build an DiagnosticsLogger that delegates to another DiagnosticsLogger but filters warnings turned off by the given pragma declarations +// +// NOTE: we allow a flag to turn of strict file checking. This is because file names sometimes don't match due to use of +// #line directives, e.g. for pars.fs/pars.fsy. In this case we just test by line number - in most cases this is sufficient +// because we install a filtering error handler on a file-by-file basis for parsing and type-checking. +// However this is indicative of a more systematic problem where source-line +// sensitive operations (lexfilter and warning filtering) do not always +// interact well with #line directives. type DiagnosticsLoggerFilteringByScopedPragmas - (langVersion: LanguageVersion, scopedPragmas, diagnosticOptions: FSharpDiagnosticOptions, diagnosticsLogger: DiagnosticsLogger) = + (checkFile, scopedPragmas, diagnosticOptions: FSharpDiagnosticOptions, diagnosticsLogger: DiagnosticsLogger) = inherit DiagnosticsLogger("DiagnosticsLoggerFilteringByScopedPragmas") - let skipFilenameChecks = - not(true || langVersion.SupportsFeature LanguageFeature.ConsistentNowarnLineDirectiveInteraction) - let mutable realErrorPresent = false override _.DiagnosticSink(diagnostic: PhasedDiagnostic, severity) = @@ -2320,9 +2323,11 @@ type DiagnosticsLoggerFilteringByScopedPragmas match diagnostic.Range with | Some m -> scopedPragmas - |> List.exists (fun (ScopedPragma.WarningOff(pragmaRange, warningNumFromPragma)) -> + |> List.exists (fun pragma -> + let (ScopedPragma.WarningOff(pragmaRange, warningNumFromPragma)) = pragma + warningNum = warningNumFromPragma - && (skipFilenameChecks || m.FileIndex = pragmaRange.FileIndex) + && (not checkFile || m.FileIndex = pragmaRange.FileIndex) && posGeq m.Start pragmaRange.Start) |> not | None -> true @@ -2339,5 +2344,5 @@ type DiagnosticsLoggerFilteringByScopedPragmas override _.CheckForRealErrorsIgnoringWarnings = realErrorPresent -let GetDiagnosticsLoggerFilteringByScopedPragmas (langVersion, scopedPragmas, diagnosticOptions, diagnosticsLogger) = - DiagnosticsLoggerFilteringByScopedPragmas(langVersion, scopedPragmas, diagnosticOptions, diagnosticsLogger) :> DiagnosticsLogger +let GetDiagnosticsLoggerFilteringByScopedPragmas (checkFile, scopedPragmas, diagnosticOptions, diagnosticsLogger) = + DiagnosticsLoggerFilteringByScopedPragmas(checkFile, scopedPragmas, diagnosticOptions, diagnosticsLogger) :> DiagnosticsLogger diff --git a/src/Compiler/Driver/CompilerDiagnostics.fsi b/src/Compiler/Driver/CompilerDiagnostics.fsi index 7c5acef17d4..6139da434cf 100644 --- a/src/Compiler/Driver/CompilerDiagnostics.fsi +++ b/src/Compiler/Driver/CompilerDiagnostics.fsi @@ -7,7 +7,6 @@ open System.Text open FSharp.Compiler.CompilerConfig open FSharp.Compiler.Diagnostics open FSharp.Compiler.DiagnosticsLogger -open FSharp.Compiler.Features open FSharp.Compiler.Syntax open FSharp.Compiler.Text @@ -85,7 +84,7 @@ type PhasedDiagnostic with /// Get a diagnostics logger that filters the reporting of warnings based on scoped pragma information val GetDiagnosticsLoggerFilteringByScopedPragmas: - langVersion: LanguageVersion * + checkFile: bool * scopedPragmas: ScopedPragma list * diagnosticOptions: FSharpDiagnosticOptions * diagnosticsLogger: DiagnosticsLogger -> diff --git a/src/Compiler/Driver/ParseAndCheckInputs.fs b/src/Compiler/Driver/ParseAndCheckInputs.fs index d5d18d79651..a6804bfe746 100644 --- a/src/Compiler/Driver/ParseAndCheckInputs.fs +++ b/src/Compiler/Driver/ParseAndCheckInputs.fs @@ -511,7 +511,7 @@ let ParseInput finally // OK, now commit the errors, since the ScopedPragmas will (hopefully) have been scraped let filteringDiagnosticsLogger = - GetDiagnosticsLoggerFilteringByScopedPragmas(lexbuf.LanguageVersion, scopedPragmas, diagnosticOptions, diagnosticsLogger) + GetDiagnosticsLoggerFilteringByScopedPragmas(false, scopedPragmas, diagnosticOptions, diagnosticsLogger) delayLogger.CommitDelayedDiagnostics filteringDiagnosticsLogger @@ -1429,7 +1429,7 @@ let CheckOneInput // Within a file, equip loggers to locally filter w.r.t. scope pragmas in each input let DiagnosticsLoggerForInput (tcConfig: TcConfig, input: ParsedInput, oldLogger) = - GetDiagnosticsLoggerFilteringByScopedPragmas(tcConfig.langVersion, input.ScopedPragmas, tcConfig.diagnosticsOptions, oldLogger) + GetDiagnosticsLoggerFilteringByScopedPragmas(false, input.ScopedPragmas, tcConfig.diagnosticsOptions, oldLogger) /// Typecheck a single file (or interactive entry into F# Interactive) let CheckOneInputEntry (ctok, checkForErrors, tcConfig: TcConfig, tcImports, tcGlobals, prefixPathOpt) tcState input = diff --git a/src/Compiler/Driver/fsc.fs b/src/Compiler/Driver/fsc.fs index 9dccdec826d..ac4ee179538 100644 --- a/src/Compiler/Driver/fsc.fs +++ b/src/Compiler/Driver/fsc.fs @@ -745,7 +745,7 @@ let main2 yield! pragmas ] - GetDiagnosticsLoggerFilteringByScopedPragmas(tcConfig.langVersion, scopedPragmas, tcConfig.diagnosticsOptions, oldLogger) + GetDiagnosticsLoggerFilteringByScopedPragmas(true, scopedPragmas, tcConfig.diagnosticsOptions, oldLogger) SetThreadDiagnosticsLoggerNoUnwind diagnosticsLogger diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 2e391fa5515..b5a50afc7c0 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1783,5 +1783,4 @@ featureEmptyBodiedComputationExpressions,"Support for computation expressions wi featureAllowAccessModifiersToAutoPropertiesGettersAndSetters,"Allow access modifiers to auto properties getters and setters" 3871,tcAccessModifiersNotAllowedInSRTPConstraint,"Access modifiers cannot be applied to an SRTP constraint." featureAllowObjectExpressionWithoutOverrides,"Allow object expressions without overrides" -3872,tcPartialActivePattern,"Multi-case partial active patterns are not supported. Consider using a single-case partial active pattern or a full active pattern." -featureConsistentNowarnLineDirectiveInteraction,"The interaction between #nowarn and #line is now consistent." +3872,tcPartialActivePattern,"Multi-case partial active patterns are not supported. Consider using a single-case partial active pattern or a full active pattern." \ No newline at end of file diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index 530d0e5f2ba..5c311237594 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -94,7 +94,6 @@ type LanguageFeature = | ParsedHashDirectiveArgumentNonQuotes | EmptyBodiedComputationExpressions | AllowObjectExpressionWithoutOverrides - | ConsistentNowarnLineDirectiveInteraction /// LanguageVersion management type LanguageVersion(versionText) = @@ -214,7 +213,6 @@ type LanguageVersion(versionText) = LanguageFeature.ParsedHashDirectiveArgumentNonQuotes, languageVersion90 LanguageFeature.EmptyBodiedComputationExpressions, languageVersion90 LanguageFeature.EnforceAttributeTargets, languageVersion90 - LanguageFeature.ConsistentNowarnLineDirectiveInteraction, languageVersion90 // F# preview LanguageFeature.UnmanagedConstraintCsharpInterop, previewVersion // not enabled because: https://github.com/dotnet/fsharp/issues/17509 @@ -377,7 +375,6 @@ type LanguageVersion(versionText) = | LanguageFeature.ParsedHashDirectiveArgumentNonQuotes -> FSComp.SR.featureParsedHashDirectiveArgumentNonString () | LanguageFeature.EmptyBodiedComputationExpressions -> FSComp.SR.featureEmptyBodiedComputationExpressions () | LanguageFeature.AllowObjectExpressionWithoutOverrides -> FSComp.SR.featureAllowObjectExpressionWithoutOverrides () - | LanguageFeature.ConsistentNowarnLineDirectiveInteraction -> FSComp.SR.featureConsistentNowarnLineDirectiveInteraction () /// Get a version string associated with the given feature. static member GetFeatureVersionString feature = diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index 4ae722c7f60..7408300b943 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -85,7 +85,6 @@ type LanguageFeature = | ParsedHashDirectiveArgumentNonQuotes | EmptyBodiedComputationExpressions | AllowObjectExpressionWithoutOverrides - | ConsistentNowarnLineDirectiveInteraction /// LanguageVersion management type LanguageVersion = diff --git a/src/Compiler/Service/IncrementalBuild.fs b/src/Compiler/Service/IncrementalBuild.fs index 7951f3c9328..b7560b222c2 100644 --- a/src/Compiler/Service/IncrementalBuild.fs +++ b/src/Compiler/Service/IncrementalBuild.fs @@ -259,7 +259,7 @@ type BoundModel private ( IncrementalBuilderEventTesting.MRU.Add(IncrementalBuilderEventTesting.IBETypechecked fileName) let capturingDiagnosticsLogger = CapturingDiagnosticsLogger("TypeCheck") - let diagnosticsLogger = GetDiagnosticsLoggerFilteringByScopedPragmas(tcConfig.langVersion, input.ScopedPragmas, tcConfig.diagnosticsOptions, capturingDiagnosticsLogger) + let diagnosticsLogger = GetDiagnosticsLoggerFilteringByScopedPragmas(false, input.ScopedPragmas, tcConfig.diagnosticsOptions, capturingDiagnosticsLogger) use _ = new CompilationGlobalsScope(diagnosticsLogger, BuildPhase.TypeCheck) beforeFileChecked.Trigger fileName diff --git a/src/Compiler/Service/TransparentCompiler.fs b/src/Compiler/Service/TransparentCompiler.fs index 735a6b241f1..e3acd1d4c6c 100644 --- a/src/Compiler/Service/TransparentCompiler.fs +++ b/src/Compiler/Service/TransparentCompiler.fs @@ -1303,12 +1303,7 @@ type internal TransparentCompiler let diagnosticsLogger = errHandler.DiagnosticsLogger let diagnosticsLogger = - GetDiagnosticsLoggerFilteringByScopedPragmas( - tcConfig.langVersion, - input.ScopedPragmas, - tcConfig.diagnosticsOptions, - diagnosticsLogger - ) + GetDiagnosticsLoggerFilteringByScopedPragmas(false, input.ScopedPragmas, tcConfig.diagnosticsOptions, diagnosticsLogger) use _ = new CompilationGlobalsScope(diagnosticsLogger, BuildPhase.TypeCheck) diff --git a/src/Compiler/pars.fsy b/src/Compiler/pars.fsy index 2588f9d128b..06c108e9b4d 100644 --- a/src/Compiler/pars.fsy +++ b/src/Compiler/pars.fsy @@ -2,7 +2,6 @@ %{ -#nowarn "64" // turn off warnings that type variables used in production annotations are instantiated to concrete type #nowarn "1182" // generated code has lots of unused "parseState" #nowarn "3261" // the generated code would need to properly annotate nulls, e.g. changing System.Object to `obj|null` diff --git a/src/Compiler/pppars.fsy b/src/Compiler/pppars.fsy index 41cb41ff38a..cd27722a254 100644 --- a/src/Compiler/pppars.fsy +++ b/src/Compiler/pppars.fsy @@ -3,7 +3,6 @@ %{ open FSharp.Compiler.DiagnosticsLogger -#nowarn "64" // turn off warnings that type variables used in production annotations are instantiated to concrete type #nowarn "3261" // the generated code would need to properly annotate nulls, e.g. changing System.Object to `obj|null` let dummy = IfdefId("DUMMY") diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index 39b41f3b382..2b1a9483def 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -307,11 +307,6 @@ Vyvolá upozornění, pokud je atribut TailCall použit u nerekurzivních funkcí. - - The interaction between #nowarn and #line is now consistent. - The interaction between #nowarn and #line is now consistent. - - Constraint intersection on flexible types Průnik omezení u flexibilních typů diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 402571c8a5a..a1b2532e4db 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -307,11 +307,6 @@ Löst Warnungen aus, wenn das Attribut "TailCall" für nicht rekursive Funktionen verwendet wird. - - The interaction between #nowarn and #line is now consistent. - The interaction between #nowarn and #line is now consistent. - - Constraint intersection on flexible types Einschränkungsüberschneidung für flexible Typen diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index d3267a7425c..dd9cbb7fec6 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -307,11 +307,6 @@ Genera advertencias si el atributo 'TailCall' se usa en funciones no recursivas. - - The interaction between #nowarn and #line is now consistent. - The interaction between #nowarn and #line is now consistent. - - Constraint intersection on flexible types Intersección de restricciones en tipos flexibles diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index f74bc4e3196..2cc92e5f4d5 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -307,11 +307,6 @@ Émet des avertissements si l’attribut « TailCall » est utilisé sur des fonctions non récursives. - - The interaction between #nowarn and #line is now consistent. - The interaction between #nowarn and #line is now consistent. - - Constraint intersection on flexible types Intersection de contraintes sur les types flexibles diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 3495d0c1659..5b5793c4841 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -307,11 +307,6 @@ Genera avvisi se l'attributo 'TailCall' viene utilizzato in funzioni non ricorsive. - - The interaction between #nowarn and #line is now consistent. - The interaction between #nowarn and #line is now consistent. - - Constraint intersection on flexible types Intersezione di vincoli su tipi flessibili diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index a87915633be..d30efc74724 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -307,11 +307,6 @@ 'TailCall' 属性が再帰関数以外で使用されている場合、警告が発せられます。 - - The interaction between #nowarn and #line is now consistent. - The interaction between #nowarn and #line is now consistent. - - Constraint intersection on flexible types フレキシブル型の制約積集合 diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 70a64e75a53..c9359c56807 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -307,11 +307,6 @@ 'TailCall' 특성이 비 재귀 함수에 사용되는 경우 경고를 발생합니다. - - The interaction between #nowarn and #line is now consistent. - The interaction between #nowarn and #line is now consistent. - - Constraint intersection on flexible types 유연한 형식의 제약 조건 교집합 diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index 31b8d2a6215..933379b9f7b 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -307,11 +307,6 @@ Zgłasza ostrzeżenia, jeśli atrybut „TailCall” jest używany w funkcjach niekursywnych. - - The interaction between #nowarn and #line is now consistent. - The interaction between #nowarn and #line is now consistent. - - Constraint intersection on flexible types Przecięcie ograniczenia dla typów elastycznych diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index c49d815ca06..e6480e13025 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -307,11 +307,6 @@ Gera avisos se o atributo "TailCall" for usado em funções não recursivas. - - The interaction between #nowarn and #line is now consistent. - The interaction between #nowarn and #line is now consistent. - - Constraint intersection on flexible types Interseção de restrição em tipos flexíveis diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 495089d8c53..61c03885917 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -307,11 +307,6 @@ Выдает предупреждения, если атрибут TailCall используется в нерекурсивных функциях. - - The interaction between #nowarn and #line is now consistent. - The interaction between #nowarn and #line is now consistent. - - Constraint intersection on flexible types Пересечение ограничений на гибких типах diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 93dfdedb2bd..09c113ee3f1 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -307,11 +307,6 @@ 'TailCall' özniteliği özyinelemeli olmayan işlevlerde kullanılıyorsa uyarılar oluşturur. - - The interaction between #nowarn and #line is now consistent. - The interaction between #nowarn and #line is now consistent. - - Constraint intersection on flexible types Esnek türlerde kısıtlama kesişimi diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 54f6b088094..d9573b5bed2 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -307,11 +307,6 @@ 如果在非递归函数上使用“TailCall”属性,则引发警告。 - - The interaction between #nowarn and #line is now consistent. - The interaction between #nowarn and #line is now consistent. - - Constraint intersection on flexible types 灵活类型的约束交集 diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index df3a706ae28..1a6c3de6ccf 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -307,11 +307,6 @@ 如果 'TailCall' 屬性用於非遞迴函數,則引發警告。 - - The interaction between #nowarn and #line is now consistent. - The interaction between #nowarn and #line is now consistent. - - Constraint intersection on flexible types 彈性類型上的條件約束交集 diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs b/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs deleted file mode 100644 index d8f12008774..00000000000 --- a/tests/FSharp.Compiler.ComponentTests/CompilerDirectives/Nowarn.fs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -namespace CompilerDirectives - -open Xunit -open FSharp.Test.Compiler - -module Nowarn = - - let warn20Text = "The result of this expression has type 'string' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'." - - [] - [] - [] - let ``line after nowarn - should warn`` (langVersion) = - - FSharp """ -module A -#nowarn "20" -#line 1 "xyz.fs" -"" // Warning disabled by # nowarn - """ - |> withLangVersion langVersion - |> compile - |> shouldFail - |> withDiagnostics [ - (Warning 20, Line 1, Col 1, Line 1, Col 3, warn20Text) - ] - - [] - [] - [] - let ``line before nowarn - should succeed`` (langVersion) = - - FSharp """ -module A -#line 1 "xyz.fs" -#nowarn "20" -"" // Warning disabled by # nowarn - """ - |> withLangVersion langVersion - |> compile - |> shouldSucceed - - - [] - [] - [] - let ``NoWarn compat nowarn without line`` (langVersion) = - - FSharp """ -module A -"" // Should produce an error -# nowarn "20" -"" // Warning disabled by # nowarn - """ - |> withLangVersion langVersion - |> compile - |> shouldFail - |> withDiagnostics [ - (Warning 20, Line 3, Col 1, Line 3, Col 3, warn20Text) - ] diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index f7e63b79621..5f352a315ee 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -33,7 +33,6 @@ - From 8d78b7e44a6d878595aabb2e26e9ce0496fa0110 Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Fri, 13 Sep 2024 10:24:35 -0700 Subject: [PATCH 4/4] readme --- docs/release-notes/.Language/preview.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index a3cb97fbdd4..b18d08e30c3 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -4,10 +4,4 @@ ### Fixed -* Allow extension methods without type attribute work for types from imported assemblies. ([PR #16368](https://github.com/dotnet/fsharp/pull/16368)) -* Enforce AttributeTargets on let values and functions. ([PR #16692](https://github.com/dotnet/fsharp/pull/16692)) -* Enforce AttributeTargets on union case declarations. ([PR #16764](https://github.com/dotnet/fsharp/pull/16764)) -* Enforce AttributeTargets on implicit constructors. ([PR #16845](https://github.com/dotnet/fsharp/pull/16845/)) -* Enforce AttributeTargets on structs and classes ([PR #16790](https://github.com/dotnet/fsharp/pull/16790)) - ### Changed