diff --git a/src/Compiler/Interactive/fsi.fs b/src/Compiler/Interactive/fsi.fs index 1c7e7bcd2ac..5cd50aadff2 100644 --- a/src/Compiler/Interactive/fsi.fs +++ b/src/Compiler/Interactive/fsi.fs @@ -4689,7 +4689,7 @@ type FsiEvaluationSession let errs = diagnosticsLogger.GetDiagnostics() let errorInfos = - DiagnosticHelpers.CreateDiagnostics(errorOptions, true, scriptFile, errs, true) + DiagnosticHelpers.CreateDiagnostics(errorOptions, true, scriptFile, errs, true, tcConfigB.flatErrors) let userRes = match res with diff --git a/src/Compiler/Service/FSharpCheckerResults.fs b/src/Compiler/Service/FSharpCheckerResults.fs index 070185bdc16..289ab29559e 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fs +++ b/src/Compiler/Service/FSharpCheckerResults.fs @@ -2207,7 +2207,8 @@ module internal ParseAndCheckFile = mainInputFileName, diagnosticsOptions: FSharpDiagnosticOptions, sourceText: ISourceText, - suggestNamesForErrors: bool + suggestNamesForErrors: bool, + flatErrors: bool ) = let mutable options = diagnosticsOptions let diagnosticsCollector = ResizeArray<_>() @@ -2218,7 +2219,16 @@ module internal ParseAndCheckFile = let collectOne severity diagnostic = for diagnostic in - DiagnosticHelpers.ReportDiagnostic(options, false, mainInputFileName, fileInfo, diagnostic, severity, suggestNamesForErrors) do + DiagnosticHelpers.ReportDiagnostic( + options, + false, + mainInputFileName, + fileInfo, + diagnostic, + severity, + suggestNamesForErrors, + flatErrors + ) do diagnosticsCollector.Add diagnostic if severity = FSharpDiagnosticSeverity.Error then @@ -2327,7 +2337,7 @@ module internal ParseAndCheckFile = usingLexbufForParsing (createLexbuf options.LangVersionText sourceText, fileName) (fun lexbuf -> let errHandler = - DiagnosticsHandler(false, fileName, options.DiagnosticOptions, sourceText, suggestNamesForErrors) + DiagnosticsHandler(false, fileName, options.DiagnosticOptions, sourceText, suggestNamesForErrors, false) let lexfun = createLexerFunction fileName options lexbuf errHandler @@ -2421,6 +2431,7 @@ module internal ParseAndCheckFile = options: FSharpParsingOptions, userOpName: string, suggestNamesForErrors: bool, + flatErrors: bool, identCapture: bool ) = Trace.TraceInformation("FCS: {0}.{1} ({2})", userOpName, "parseFile", fileName) @@ -2429,7 +2440,7 @@ module internal ParseAndCheckFile = Activity.start "ParseAndCheckFile.parseFile" [| Activity.Tags.fileName, fileName |] let errHandler = - DiagnosticsHandler(true, fileName, options.DiagnosticOptions, sourceText, suggestNamesForErrors) + DiagnosticsHandler(true, fileName, options.DiagnosticOptions, sourceText, suggestNamesForErrors, flatErrors) use _ = UseDiagnosticsLogger errHandler.DiagnosticsLogger @@ -2596,7 +2607,14 @@ module internal ParseAndCheckFile = // Initialize the error handler let errHandler = - DiagnosticsHandler(true, mainInputFileName, tcConfig.diagnosticsOptions, sourceText, suggestNamesForErrors) + DiagnosticsHandler( + true, + mainInputFileName, + tcConfig.diagnosticsOptions, + sourceText, + suggestNamesForErrors, + tcConfig.flatErrors + ) use _ = UseDiagnosticsLogger errHandler.DiagnosticsLogger @@ -3260,6 +3278,7 @@ type FsiInteractiveChecker(legacyReferenceResolver, tcConfig: TcConfig, tcGlobal parsingOptions, userOpName, suggestNamesForErrors, + tcConfig.flatErrors, tcConfig.captureIdentifiersWhenParsing ) diff --git a/src/Compiler/Service/FSharpCheckerResults.fsi b/src/Compiler/Service/FSharpCheckerResults.fsi index 6eb541982d0..2283ffcdf49 100644 --- a/src/Compiler/Service/FSharpCheckerResults.fsi +++ b/src/Compiler/Service/FSharpCheckerResults.fsi @@ -537,6 +537,7 @@ module internal ParseAndCheckFile = options: FSharpParsingOptions * userOpName: string * suggestNamesForErrors: bool * + flatErrors: bool * identCapture: bool -> FSharpDiagnostic[] * ParsedInput * bool diff --git a/src/Compiler/Service/IncrementalBuild.fs b/src/Compiler/Service/IncrementalBuild.fs index dc27983338e..5403a37b86b 100644 --- a/src/Compiler/Service/IncrementalBuild.fs +++ b/src/Compiler/Service/IncrementalBuild.fs @@ -1599,16 +1599,18 @@ type IncrementalBuilder(initialState: IncrementalBuilderInitialState, state: Inc } let diagnostics = - match builderOpt with - | Some builder -> - let diagnosticsOptions = builder.TcConfig.diagnosticsOptions - let diagnosticsLogger = CompilationDiagnosticLogger("IncrementalBuilderCreation", diagnosticsOptions) - delayedLogger.CommitDelayedDiagnostics diagnosticsLogger - diagnosticsLogger.GetDiagnostics() - | _ -> - Array.ofList delayedLogger.Diagnostics + let diagnostics, flatErrors = + match builderOpt with + | Some builder -> + let diagnosticsOptions = builder.TcConfig.diagnosticsOptions + let diagnosticsLogger = CompilationDiagnosticLogger("IncrementalBuilderCreation", diagnosticsOptions) + delayedLogger.CommitDelayedDiagnostics diagnosticsLogger + diagnosticsLogger.GetDiagnostics(), builder.TcConfig.flatErrors + | _ -> + Array.ofList delayedLogger.Diagnostics, false + diagnostics |> Array.map (fun (diagnostic, severity) -> - FSharpDiagnostic.CreateFromException(diagnostic, severity, range.Zero, suggestNamesForErrors)) + FSharpDiagnostic.CreateFromException(diagnostic, severity, range.Zero, suggestNamesForErrors, flatErrors)) return builderOpt, diagnostics } \ No newline at end of file diff --git a/src/Compiler/Service/ServiceAssemblyContent.fs b/src/Compiler/Service/ServiceAssemblyContent.fs index 0a89eb646d2..2b54ed7f229 100644 --- a/src/Compiler/Service/ServiceAssemblyContent.fs +++ b/src/Compiler/Service/ServiceAssemblyContent.fs @@ -247,7 +247,7 @@ module AssemblyContent = // are not triggered (see "if not entity.IsProvided") and the other data accessed is immutable or computed safely // on-demand. However a more compete review may be warranted. - use _ignoreAllDiagnostics = new DiagnosticsScope() + use _ignoreAllDiagnostics = new DiagnosticsScope(false) signature.TryGetEntities() |> Seq.collect (traverseEntity contentType Parent.Empty) @@ -265,7 +265,7 @@ module AssemblyContent = // concurrently with other threads. On an initial review this is not a problem since type provider computations // are not triggered (see "if not entity.IsProvided") and the other data accessed is immutable or computed safely // on-demand. However a more compete review may be warranted. - use _ignoreAllDiagnostics = new DiagnosticsScope() + use _ignoreAllDiagnostics = new DiagnosticsScope(false) #if !NO_TYPEPROVIDERS match assemblies |> List.filter (fun x -> not x.IsProviderGenerated), fileName with diff --git a/src/Compiler/Service/ServiceParsedInputOps.fs b/src/Compiler/Service/ServiceParsedInputOps.fs index 91c48c42bcb..a0f8a810ccb 100644 --- a/src/Compiler/Service/ServiceParsedInputOps.fs +++ b/src/Compiler/Service/ServiceParsedInputOps.fs @@ -2012,7 +2012,7 @@ module ParsedInput = // We ignore all diagnostics during this operation // // Based on an initial review, no diagnostics should be generated. However the code should be checked more closely. - use _ignoreAllDiagnostics = new DiagnosticsScope() + use _ignoreAllDiagnostics = new DiagnosticsScope(false) let mutable result = None let mutable ns = None @@ -2175,7 +2175,7 @@ module ParsedInput = // We ignore all diagnostics during this operation // // Based on an initial review, no diagnostics should be generated. However the code should be checked more closely. - use _ignoreAllDiagnostics = new DiagnosticsScope() + use _ignoreAllDiagnostics = new DiagnosticsScope(false) match res with | None -> [||] diff --git a/src/Compiler/Service/service.fs b/src/Compiler/Service/service.fs index 8b39b71e69a..ee52dd45e80 100644 --- a/src/Compiler/Service/service.fs +++ b/src/Compiler/Service/service.fs @@ -99,14 +99,14 @@ module Helpers = | _ -> false module CompileHelpers = - let mkCompilationDiagnosticsHandlers () = + let mkCompilationDiagnosticsHandlers (flatErrors) = let diagnostics = ResizeArray<_>() let diagnosticsLogger = { new DiagnosticsLogger("CompileAPI") with member _.DiagnosticSink(diag, isError) = - diagnostics.Add(FSharpDiagnostic.CreateFromException(diag, isError, range0, true)) // Suggest names for errors + diagnostics.Add(FSharpDiagnostic.CreateFromException(diag, isError, range0, true, flatErrors)) // Suggest names for errors member _.ErrorCount = diagnostics @@ -137,7 +137,8 @@ module CompileHelpers = /// Compile using the given flags. Source files names are resolved via the FileSystem API. The output file must be given by a -o flag. let compileFromArgs (ctok, argv: string[], legacyReferenceResolver, tcImportsCapture, dynamicAssemblyCreator) = - let diagnostics, diagnosticsLogger, loggerProvider = mkCompilationDiagnosticsHandlers () + let diagnostics, diagnosticsLogger, loggerProvider = + mkCompilationDiagnosticsHandlers (argv |> Array.contains "--flaterrors") let result = tryCompile diagnosticsLogger (fun exiter -> @@ -487,7 +488,7 @@ type BackgroundCompiler checkFileInProjectCache.Set(ltok, key, res) res) - member _.ParseFile(fileName: string, sourceText: ISourceText, options: FSharpParsingOptions, cache: bool, userOpName: string) = + member _.ParseFile(fileName: string, sourceText: ISourceText, options: FSharpParsingOptions, cache: bool, flatErrors: bool, userOpName: string) = async { use _ = Activity.start @@ -507,14 +508,22 @@ type BackgroundCompiler Interlocked.Increment(&actualParseFileCount) |> ignore let parseDiagnostics, parseTree, anyErrors = - ParseAndCheckFile.parseFile (sourceText, fileName, options, userOpName, suggestNamesForErrors, captureIdentifiersWhenParsing) + ParseAndCheckFile.parseFile ( + sourceText, + fileName, + options, + userOpName, + suggestNamesForErrors, + flatErrors, + captureIdentifiersWhenParsing + ) let res = FSharpParseFileResults(parseDiagnostics, parseTree, anyErrors, options.SourceFiles) parseCacheLock.AcquireLock(fun ltok -> parseFileCache.Set(ltok, (fileName, hash, options), res)) return res else let parseDiagnostics, parseTree, anyErrors = - ParseAndCheckFile.parseFile (sourceText, fileName, options, userOpName, false, captureIdentifiersWhenParsing) + ParseAndCheckFile.parseFile (sourceText, fileName, options, userOpName, false, flatErrors, captureIdentifiersWhenParsing) return FSharpParseFileResults(parseDiagnostics, parseTree, anyErrors, options.SourceFiles) } @@ -537,7 +546,14 @@ type BackgroundCompiler let parseTree, _, _, parseDiagnostics = builder.GetParseResultsForFile fileName let parseDiagnostics = - DiagnosticHelpers.CreateDiagnostics(builder.TcConfig.diagnosticsOptions, false, fileName, parseDiagnostics, suggestNamesForErrors) + DiagnosticHelpers.CreateDiagnostics( + builder.TcConfig.diagnosticsOptions, + false, + fileName, + parseDiagnostics, + suggestNamesForErrors, + builder.TcConfig.flatErrors + ) let diagnostics = [| yield! creationDiags; yield! parseDiagnostics |] @@ -767,6 +783,7 @@ type BackgroundCompiler parsingOptions, userOpName, suggestNamesForErrors, + builder.TcConfig.flatErrors, captureIdentifiersWhenParsing ) @@ -835,12 +852,26 @@ type BackgroundCompiler let diagnosticsOptions = builder.TcConfig.diagnosticsOptions let parseDiagnostics = - DiagnosticHelpers.CreateDiagnostics(diagnosticsOptions, false, fileName, parseDiagnostics, suggestNamesForErrors) + DiagnosticHelpers.CreateDiagnostics( + diagnosticsOptions, + false, + fileName, + parseDiagnostics, + suggestNamesForErrors, + builder.TcConfig.flatErrors + ) let parseDiagnostics = [| yield! creationDiags; yield! parseDiagnostics |] let tcDiagnostics = - DiagnosticHelpers.CreateDiagnostics(diagnosticsOptions, false, fileName, tcDiagnostics, suggestNamesForErrors) + DiagnosticHelpers.CreateDiagnostics( + diagnosticsOptions, + false, + fileName, + tcDiagnostics, + suggestNamesForErrors, + builder.TcConfig.flatErrors + ) let tcDiagnostics = [| yield! creationDiags; yield! tcDiagnostics |] @@ -994,7 +1025,14 @@ type BackgroundCompiler let tcDependencyFiles = tcInfo.tcDependencyFiles let tcDiagnostics = - DiagnosticHelpers.CreateDiagnostics(diagnosticsOptions, true, fileName, tcDiagnostics, suggestNamesForErrors) + DiagnosticHelpers.CreateDiagnostics( + diagnosticsOptions, + true, + fileName, + tcDiagnostics, + suggestNamesForErrors, + builder.TcConfig.flatErrors + ) let diagnostics = [| yield! creationDiags; yield! tcDiagnostics |] @@ -1083,8 +1121,6 @@ type BackgroundCompiler [| Activity.Tags.fileName, fileName; Activity.Tags.userOpName, _userOpName |] cancellable { - use diagnostics = new DiagnosticsScope() - // Do we add a reference to FSharp.Compiler.Interactive.Settings by default? let useFsiAuxLib = defaultArg useFsiAuxLib true let useSdkRefs = defaultArg useSdkRefs true @@ -1102,6 +1138,8 @@ type BackgroundCompiler let otherFlags = defaultArg otherFlags extraFlags + use diagnostics = new DiagnosticsScope(otherFlags |> Array.contains "--flaterrors") + let useSimpleResolution = otherFlags |> Array.exists (fun x -> x = "--simpleresolution") let loadedTimeStamp = defaultArg loadedTimeStamp DateTime.MaxValue // Not 'now', we don't want to force reloading @@ -1159,7 +1197,8 @@ type BackgroundCompiler let diags = loadClosure.LoadClosureRootFileDiagnostics - |> List.map (fun (exn, isError) -> FSharpDiagnostic.CreateFromException(exn, isError, range.Zero, false)) + |> List.map (fun (exn, isError) -> + FSharpDiagnostic.CreateFromException(exn, isError, range.Zero, false, options.OtherOptions |> Array.contains "--flaterrors")) return options, (diags @ diagnostics.Diagnostics) } @@ -1414,7 +1453,7 @@ type FSharpChecker member _.ParseFile(fileName, sourceText, options, ?cache, ?userOpName: string) = let cache = defaultArg cache true let userOpName = defaultArg userOpName "Unknown" - backgroundCompiler.ParseFile(fileName, sourceText, options, cache, userOpName) + backgroundCompiler.ParseFile(fileName, sourceText, options, cache, false, userOpName) member ic.ParseFileInProject(fileName, source: string, options, ?cache: bool, ?userOpName: string) = let parsingOptions, _ = ic.GetParsingOptionsFromProjectOptions(options) @@ -1650,7 +1689,7 @@ type FSharpChecker member _.GetParsingOptionsFromCommandLineArgs(sourceFiles, argv, ?isInteractive, ?isEditing) = let isEditing = defaultArg isEditing false let isInteractive = defaultArg isInteractive false - use errorScope = new DiagnosticsScope() + use errorScope = new DiagnosticsScope(argv |> List.contains "--flaterrors") let tcConfigB = TcConfigBuilder.CreateNew( diff --git a/src/Compiler/Symbols/FSharpDiagnostic.fs b/src/Compiler/Symbols/FSharpDiagnostic.fs index c4b57e84c9f..f621860d6a1 100644 --- a/src/Compiler/Symbols/FSharpDiagnostic.fs +++ b/src/Compiler/Symbols/FSharpDiagnostic.fs @@ -71,15 +71,15 @@ type FSharpDiagnostic(m: range, severity: FSharpDiagnosticSeverity, message: str sprintf "%s (%d,%d)-(%d,%d) %s %s %s" fileName s.Line (s.Column + 1) e.Line (e.Column + 1) subcategory severity message /// Decompose a warning or error into parts: position, severity, message, error number - static member CreateFromException(diagnostic: PhasedDiagnostic, severity, fallbackRange: range, suggestNames: bool) = + static member CreateFromException(diagnostic: PhasedDiagnostic, severity, fallbackRange: range, suggestNames: bool, flatErrors: bool) = let m = match diagnostic.Range with Some m -> m | None -> fallbackRange - let msg = diagnostic.FormatCore(false, suggestNames) + let msg = diagnostic.FormatCore(flatErrors, suggestNames) let errorNum = diagnostic.Number FSharpDiagnostic(m, severity, msg, diagnostic.Subcategory(), errorNum, "FS") /// Decompose a warning or error into parts: position, severity, message, error number - static member CreateFromExceptionAndAdjustEof(diagnostic, severity, fallbackRange: range, (linesCount: int, lastLength: int), suggestNames: bool) = - let diagnostic = FSharpDiagnostic.CreateFromException(diagnostic, severity, fallbackRange, suggestNames) + static member CreateFromExceptionAndAdjustEof(diagnostic, severity, fallbackRange: range, (linesCount: int, lastLength: int), suggestNames: bool, flatErrors: bool) = + let diagnostic = FSharpDiagnostic.CreateFromException(diagnostic, severity, fallbackRange, suggestNames, flatErrors) // Adjust to make sure that diagnostics reported at Eof are shown at the linesCount let startLine, startChanged = min (Line.toZ diagnostic.Range.StartLine, false) (linesCount, true) @@ -102,7 +102,7 @@ type FSharpDiagnostic(m: range, severity: FSharpDiagnosticSeverity, message: str /// Use to reset error and warning handlers [] -type DiagnosticsScope() = +type DiagnosticsScope(flatErrors: bool) = let mutable diags = [] let unwindBP = UseBuildPhase BuildPhase.TypeCheck let unwindEL = @@ -110,7 +110,7 @@ type DiagnosticsScope() = { new DiagnosticsLogger("DiagnosticsScope") with member _.DiagnosticSink(diagnostic, severity) = - let diagnostic = FSharpDiagnostic.CreateFromException(diagnostic, severity, range.Zero, false) + let diagnostic = FSharpDiagnostic.CreateFromException(diagnostic, severity, range.Zero, false, flatErrors) diags <- diagnostic :: diags member _.ErrorCount = diags.Length } @@ -139,7 +139,7 @@ type DiagnosticsScope() = /// autocomplete, then the error message is shown in replacement of the text (rather than crashing Visual /// Studio, or swallowing the exception completely) static member Protect<'a> (m: range) (f: unit->'a) (err: string->'a): 'a = - use diagnosticsScope = new DiagnosticsScope() + use diagnosticsScope = new DiagnosticsScope(false) let res = try Some (f()) @@ -184,7 +184,7 @@ type internal CompilationDiagnosticLogger (debugName: string, options: FSharpDia module DiagnosticHelpers = - let ReportDiagnostic (options: FSharpDiagnosticOptions, allErrors, mainInputFileName, fileInfo, diagnostic: PhasedDiagnostic, severity, suggestNames) = + let ReportDiagnostic (options: FSharpDiagnosticOptions, allErrors, mainInputFileName, fileInfo, diagnostic: PhasedDiagnostic, severity, suggestNames, flatErrors) = [ let severity = if diagnostic.ReportAsError (options, severity) then FSharpDiagnosticSeverity.Error @@ -198,12 +198,12 @@ module DiagnosticHelpers = // We use the first line of the file as a fallbackRange for reporting unexpected errors. // Not ideal, but it's hard to see what else to do. let fallbackRange = rangeN mainInputFileName 1 - let diagnostic = FSharpDiagnostic.CreateFromExceptionAndAdjustEof (diagnostic, severity, fallbackRange, fileInfo, suggestNames) + let diagnostic = FSharpDiagnostic.CreateFromExceptionAndAdjustEof (diagnostic, severity, fallbackRange, fileInfo, suggestNames, flatErrors) let fileName = diagnostic.Range.FileName if allErrors || fileName = mainInputFileName || fileName = TcGlobals.DummyFileNameForRangesWithoutASpecificLocation then yield diagnostic ] - let CreateDiagnostics (options, allErrors, mainInputFileName, diagnostics, suggestNames) = + let CreateDiagnostics (options, allErrors, mainInputFileName, diagnostics, suggestNames, flatErrors) = let fileInfo = (Int32.MaxValue, Int32.MaxValue) [| for diagnostic, severity in diagnostics do - yield! ReportDiagnostic (options, allErrors, mainInputFileName, fileInfo, diagnostic, severity, suggestNames) |] + yield! ReportDiagnostic (options, allErrors, mainInputFileName, fileInfo, diagnostic, severity, suggestNames, flatErrors) |] diff --git a/src/Compiler/Symbols/FSharpDiagnostic.fsi b/src/Compiler/Symbols/FSharpDiagnostic.fsi index 313c14240e4..fca4ad77061 100644 --- a/src/Compiler/Symbols/FSharpDiagnostic.fsi +++ b/src/Compiler/Symbols/FSharpDiagnostic.fsi @@ -71,11 +71,16 @@ type public FSharpDiagnostic = severity: FSharpDiagnosticSeverity * range * lastPosInFile: (int * int) * - suggestNames: bool -> + suggestNames: bool * + flatErrors: bool -> FSharpDiagnostic static member internal CreateFromException: - diagnostic: PhasedDiagnostic * severity: FSharpDiagnosticSeverity * range * suggestNames: bool -> + diagnostic: PhasedDiagnostic * + severity: FSharpDiagnosticSeverity * + range * + suggestNames: bool * + flatErrors: bool -> FSharpDiagnostic /// Newlines are recognized and replaced with (ASCII 29, the 'group separator'), @@ -95,7 +100,7 @@ type internal DiagnosticsScope = interface IDisposable - new: unit -> DiagnosticsScope + new: bool -> DiagnosticsScope member Diagnostics: FSharpDiagnostic list @@ -122,7 +127,8 @@ module internal DiagnosticHelpers = fileInfo: (int * int) * diagnostic: PhasedDiagnostic * severity: FSharpDiagnosticSeverity * - suggestNames: bool -> + suggestNames: bool * + flatErrors: bool -> FSharpDiagnostic list val CreateDiagnostics: @@ -130,5 +136,6 @@ module internal DiagnosticHelpers = allErrors: bool * mainInputFileName: string * seq * - suggestNames: bool -> + suggestNames: bool * + flatErrors: bool -> FSharpDiagnostic[] diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors.fs b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors.fs new file mode 100644 index 00000000000..bd917a838c2 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors.fs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.ComponentTests.CompilerOptions + +open Xunit +open System +open FSharp.Test.Compiler + +//# Sanity check - simply check that the option is valid +module flaterrors = + + //# Functional: the option does what it is meant to do + let compile (options: string) compilation = + let options = + if String.IsNullOrEmpty options then [||] + else options.Split([|';'|]) |> Array.map(fun s -> s.Trim()) + compilation + |> asExe + |> withOptions (options |> Array.toList) + |> compile + + [] // default -off- + [] + let ``E_MultiLine01_fs`` (options: string) = + Fs """List.rev {1..10}""" + |> compile options + |> shouldFail + |> withDiagnostics [ + (Error 1, Line 1, Col 11, Line 1, Col 16, "This expression was expected to have type\n ''a list' \nbut here has type\n 'seq<'b>' ") + (Error 1, Line 1, Col 11, Line 1, Col 16, "This expression was expected to have type\n ''a list' \nbut here has type\n 'seq' ") + (Warning 20, Line 1, Col 1, Line 1, Col 17, "The result of this expression has type ''a list' 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'.") + ] + + [] //once + [] //twice + [] // with nologo + [] + let ``E_MultiLine02_fs`` (options: string) = + Fs """List.rev {1..10} |> ignore""" + |> compile options + |> shouldFail + |> withDiagnostics [ + (Error 1, Line 1, Col 11, Line 1, Col 16, "This expression was expected to have type\029 ''a list' \029but here has type\029 'seq<'b>'") + (Error 1, Line 1, Col 11, Line 1, Col 16, "This expression was expected to have type\029 ''a list' \029but here has type\029 'seq'") + ] + + [] //once + [] //twice + [] // with nologo + [] // with out + [] + let ``E_MultiLine03_fs`` (options: string) = + Fs """let a = b""" + |> compile options + |> shouldFail + |> withDiagnostics [ + (Error 39, Line 1, Col 9, Line 1, Col 10, """The value or constructor 'b' is not defined.""") + ] + + [] //Invalid case + [] //Even more invalid case + [] // no + allowed + [] // no - allowed + [] + let ``E_MultiLine04_fs`` (option: string) = + Fs """List.rev {1..10} |> ignore""" + |> compile option + |> shouldFail + |> withDiagnostics [ + (Error 243, Line 0, Col 1, Line 0, Col 1, $"Unrecognized option: '{option}'. Use '--help' to learn about recognized command line options.") + ] diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors/E_MultiLine01.fs b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors/E_MultiLine01.fs new file mode 100644 index 00000000000..fcb5e10f2ae --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors/E_MultiLine01.fs @@ -0,0 +1,8 @@ +// #Regression #NoMT #CompilerOptions #RequiresENU +// Test that without [--flaterrors] flag multi-line errors are emitted in a regular way, i.e. spanned to more that one line +//This expression was expected to have type +// ''a list' +//but here has type +// 'seq<'b>' + +List.rev {1..10} diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors/E_MultiLine02.fs b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors/E_MultiLine02.fs new file mode 100644 index 00000000000..511987567fc --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors/E_MultiLine02.fs @@ -0,0 +1,5 @@ +// #Regression #NoMT #CompilerOptions +// Test that using [--flaterrors] flag multi-line errors are flattened, i.e. concatenated into one-line error message. +//This expression was expected to have type. ''a list' .but here has type. 'seq<'b>' + +List.rev {1..10} |> ignore diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors/E_MultiLine03.fs b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors/E_MultiLine03.fs new file mode 100644 index 00000000000..7df7e334e11 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors/E_MultiLine03.fs @@ -0,0 +1,5 @@ +// #Regression #NoMT #CompilerOptions +// Test that using [--flaterrors] does not make an impact on regular single-line error messages +//The value or constructor 'b' is not defined + +let a = b diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors/E_MultiLine04.fs b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors/E_MultiLine04.fs new file mode 100644 index 00000000000..31c3bf614e8 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors/E_MultiLine04.fs @@ -0,0 +1,5 @@ +// #Regression #NoMT #CompilerOptions +// Used by various [--flaterrors] tests +//Unrecognized option: '.+' + +exit 0 diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors/env.lst b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors/env.lst new file mode 100644 index 00000000000..3567d73aece --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/flaterrors/env.lst @@ -0,0 +1,19 @@ +# Functional: the option does what it is meant to do +ReqENU SOURCE=E_MultiLine01.fs # E_MultiLine01.fs + SOURCE=E_MultiLine02.fs SCFLAGS="--flaterrors" # E_MultiLine02.fs + SOURCE=E_MultiLine03.fs SCFLAGS="--flaterrors" # E_MultiLine03.fs + +# In combination with --nologo, --out + SOURCE=E_MultiLine02.fs SCFLAGS="--flaterrors --nologo" # Combined01 + SOURCE=E_MultiLine03.fs SCFLAGS="--out:E_MultiLine03.exe --flaterrors" # Combined02 + +# Last one wins... (multiple-usage) + SOURCE=E_MultiLine02.fs COMPILE_ONLY=1 SCFLAGS="--flaterrors --flaterrors" # MultipleUse + +# Option is case sentitive + SOURCE=E_MultiLine04.fs COMPILE_ONLY=1 SCFLAGS="--FlatErrors" # CaseSensitive01 + SOURCE=E_MultiLine04.fs COMPILE_ONLY=1 SCFLAGS="--FLATERRORS" # CaseSensitive02 + +# Mispelled options + SOURCE=E_MultiLine04.fs COMPILE_ONLY=1 SCFLAGS="-flaterrors" # Mispelled01 + SOURCE=E_MultiLine04.fs COMPILE_ONLY=1 SCFLAGS="--flaterrors+" # Mispelled02 \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/InferenceProcedures/RecursiveSafetyAnalysis/RecursiveSafetyAnalysis.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/InferenceProcedures/RecursiveSafetyAnalysis/RecursiveSafetyAnalysis.fs index f75ee8440a2..39ad13a3e9e 100644 --- a/tests/FSharp.Compiler.ComponentTests/Conformance/InferenceProcedures/RecursiveSafetyAnalysis/RecursiveSafetyAnalysis.fs +++ b/tests/FSharp.Compiler.ComponentTests/Conformance/InferenceProcedures/RecursiveSafetyAnalysis/RecursiveSafetyAnalysis.fs @@ -25,7 +25,7 @@ module RecursiveSafetyAnalysis = |> shouldFail |> withDiagnostics [ (Error 953, Line 6, Col 6, Line 6, Col 15, "This type definition involves an immediate cyclic reference through an abbreviation") - (Error 1, Line 8, Col 25, Line 8, Col 34, "This expression was expected to have type\n 'bogusType' \nbut here has type\n 'Map<'a,'b>' ") + (Error 1, Line 8, Col 25, Line 8, Col 34, "This expression was expected to have type 'bogusType' but here has type 'Map<'a,'b>'") ] // SOURCE=E_DuplicateRecursiveRecords.fs SCFLAGS="--test:ErrorRanges" # E_DuplicateRecursiveRecords.fs diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index a83d57f55a5..dcc966aface 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -212,6 +212,7 @@ + diff --git a/tests/service/EditorTests.fs b/tests/service/EditorTests.fs index 74a96b665de..53d7e01d501 100644 --- a/tests/service/EditorTests.fs +++ b/tests/service/EditorTests.fs @@ -576,12 +576,13 @@ let s3 = $"abc %d{s.Length} typeCheckResults.Diagnostics |> shouldEqual [||] typeCheckResults.GetFormatSpecifierLocationsAndArity() |> Array.map (fun (range,numArgs) -> range.StartLine, range.StartColumn, range.EndLine, range.EndColumn, numArgs) - |> shouldEqual - [|(3, 10, 3, 12, 1); (4, 10, 4, 15, 1); (5, 10, 5, 16, 1); (7, 11, 7, 15, 1); - (8, 11, 8, 14, 1); (10, 12, 10, 15, 1); (13, 12, 13, 15, 1); - (14, 38, 14, 40, 1); (16, 12, 16, 18, 1); (17, 11, 17, 13, 1); - (17, 18, 17, 22, 1); (18, 10, 18, 12, 0); (19, 15, 19, 17, 1); - (19, 32, 19, 34, 1); (20, 15, 20, 17, 1); (21, 20, 21, 22, 1)|] + |> shouldEqual [| + (3, 10, 3, 12, 1); (4, 10, 4, 15, 1); (5, 10, 5, 16, 1); (7, 11, 7, 15, 1); + (8, 11, 8, 14, 1); (13, 12, 13, 15, 1); (14, 38, 14, 40, 1); + (16, 12, 16, 18, 1); (17, 11, 17, 13, 1); (17, 18, 17, 22, 1); + (18, 10, 18, 12, 0); (19, 15, 19, 17, 1); (19, 32, 19, 34, 1); + (20, 15, 20, 17, 1); (21, 20, 21, 22, 1) + |] [] let ``Printf specifiers for triple quote interpolated strings`` () = diff --git a/tests/service/PatternMatchCompilationTests.fs b/tests/service/PatternMatchCompilationTests.fs index 49117c04cea..78ab60e8d04 100644 --- a/tests/service/PatternMatchCompilationTests.fs +++ b/tests/service/PatternMatchCompilationTests.fs @@ -15,7 +15,7 @@ match () with """ assertHasSymbolUsages ["x"; "y"] checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(3,2--3,4): This expression was expected to have type 'unit' but here has type 'string'" + "(3,2--3,4): This expression was expected to have type\u001d 'unit' \u001dbut here has type\u001d 'string'" ] [] @@ -28,12 +28,11 @@ let ("": unit), (x: int) = let y = () in () """ assertHasSymbolUsages ["x"; "y"] checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(2,5--2,7): This expression was expected to have type 'unit' but here has type 'string'" - "(2,41--2,43): This expression was expected to have type 'unit * int' but here has type 'unit'" + "(2,5--2,7): This expression was expected to have type\u001d 'unit' \u001dbut here has type\u001d 'string'"; + "(2,41--2,43): This expression was expected to have type\u001d 'unit * int' \u001dbut here has type\u001d 'unit'"; "(2,4--2,24): Incomplete pattern matches on this expression." ] - [] #if !NETCOREAPP [] @@ -96,7 +95,7 @@ match A with """ assertHasSymbolUsages ["x"; "y"] checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(7,5--7,12): This expression was expected to have type 'int' but here has type ''a * 'b * 'c'" + "(7,5--7,12): This expression was expected to have type\u001d 'int' \u001dbut here has type\u001d ''a * 'b * 'c'"; "(6,6--6,7): Incomplete pattern matches on this expression." ] @@ -301,11 +300,11 @@ match A with """ assertHasSymbolUsages ["x"; "y"; "z"] checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(7,2--7,21): The two sides of this 'or' pattern bind different sets of variables" - "(7,19--7,20): This expression was expected to have type 'int' but here has type 'string'" + "(7,2--7,21): The two sides of this 'or' pattern bind different sets of variables"; + "(7,19--7,20): This expression was expected to have type\u001d 'int' \u001dbut here has type\u001d 'string'"; "(6,6--6,7): Incomplete pattern matches on this expression. For example, the value 'A' may indicate a case not covered by the pattern(s)." ] - + [] let ``As 01 - names and wildcards`` () = let _, checkResults = getParseAndCheckResults70 """ @@ -362,7 +361,7 @@ match Unchecked.defaultof with """ assertHasSymbolUsages ["a"; "b"; "c"; "d"] checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(5,21--5,27): Type constraint mismatch. The type 'int' is not compatible with type 'System.Enum' " + "(5,21--5,27): Type constraint mismatch. The type \u001d 'int' \u001dis not compatible with type\u001d 'System.Enum'" ] [] @@ -582,24 +581,24 @@ let x as () = y let z as """ dumpDiagnostics checkResults |> shouldEqual [ - "(10,9--10,10): Unexpected symbol ',' in binding" - "(11,9--11,10): Unexpected symbol ':' in binding" - "(12,9--12,11): Unexpected symbol '::' in binding" - "(13,9--13,10): Unexpected symbol '&' in binding" - "(14,9--14,10): Unexpected symbol '|' in binding" - "(15,13--15,14): Unexpected symbol '=' in pattern. Expected ')' or other token." - "(15,9--15,10): Unmatched '('" - "(16,0--16,3): Possible incorrect indentation: this token is offside of context started at position (15:1). Try indenting this token further or using standard formatting conventions." - "(17,16--17,17): Unexpected identifier in pattern. Expected '(' or other token." - "(20,0--20,0): Incomplete structured construct at or before this point in binding" - "(3,13--3,17): This expression was expected to have type 'int' but here has type 'bool'" - "(3,4--3,10): Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s)." - "(4,16--4,17): This expression was expected to have type 'bool' but here has type 'int'" - "(4,4--4,13): Incomplete pattern matches on this expression. For example, the value 'false' may indicate a case not covered by the pattern(s)." - "(5,9--5,15): This runtime coercion or type test from type 'a to int involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." - "(6,9--6,15): This runtime coercion or type test from type 'a to int involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." - "(8,29--8,30): This expression was expected to have type 'unit' but here has type 'int'" - "(9,26--9,27): This expression was expected to have type 'unit' but here has type 'int'" + "(10,9--10,10): Unexpected symbol ',' in binding"; + "(11,9--11,10): Unexpected symbol ':' in binding"; + "(12,9--12,11): Unexpected symbol '::' in binding"; + "(13,9--13,10): Unexpected symbol '&' in binding"; + "(14,9--14,10): Unexpected symbol '|' in binding"; + "(15,13--15,14): Unexpected symbol '=' in pattern. Expected ')' or other token."; + "(15,9--15,10): Unmatched '('"; + "(16,0--16,3): Possible incorrect indentation: this token is offside of context started at position (15:1). Try indenting this token further or using standard formatting conventions."; + "(17,16--17,17): Unexpected identifier in pattern. Expected '(' or other token."; + "(20,0--20,0): Incomplete structured construct at or before this point in binding"; + "(3,13--3,17): This expression was expected to have type\u001d 'int' \u001dbut here has type\u001d 'bool'"; + "(3,4--3,10): Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s)."; + "(4,16--4,17): This expression was expected to have type\u001d 'bool' \u001dbut here has type\u001d 'int'"; + "(4,4--4,13): Incomplete pattern matches on this expression. For example, the value 'false' may indicate a case not covered by the pattern(s)."; + "(5,9--5,15): This runtime coercion or type test from type\u001d 'a \u001d to \u001d int \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(6,9--6,15): This runtime coercion or type test from type\u001d 'a \u001d to \u001d int \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(8,29--8,30): This expression was expected to have type\u001d 'unit' \u001dbut here has type\u001d 'int'"; + "(9,26--9,27): This expression was expected to have type\u001d 'unit' \u001dbut here has type\u001d 'int'"; "(18,14--18,15): The value or constructor 'y' is not defined." ] @@ -718,30 +717,30 @@ let () as x = y let z as = """ dumpDiagnostics checkResults |> shouldEqual [ - "(10,7--10,9): Unexpected keyword 'as' in binding" - "(10,5--10,6): Expecting pattern" - "(11,10--11,12): Unexpected keyword 'as' in binding. Expected '=' or other token." - "(12,9--12,11): Unexpected keyword 'as' in binding" - "(13,8--13,10): Unexpected keyword 'as' in binding" - "(14,8--14,10): Unexpected keyword 'as' in binding" - "(15,8--15,10): Unexpected keyword 'as' in pattern. Expected ')' or other token." - "(15,6--15,7): Unmatched '('" - "(16,0--16,3): Possible incorrect indentation: this token is offside of context started at position (15:1). Try indenting this token further or using standard formatting conventions." - "(16,0--16,3): Unexpected keyword 'let' or 'use' in binding. Expected incomplete structured construct at or before this point or other token." - "(15,0--15,3): Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword." - "(17,0--17,3): Incomplete structured construct at or before this point in implementation file" - "(20,0--20,0): Possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this token further or using standard formatting conventions." - "(20,0--20,0): Possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this token further or using standard formatting conventions." - "(3,13--3,17): This expression was expected to have type 'int' but here has type 'bool'" - "(3,4--3,10): Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s)." - "(4,16--4,17): This expression was expected to have type 'bool' but here has type 'int'" - "(4,4--4,13): Incomplete pattern matches on this expression. For example, the value 'false' may indicate a case not covered by the pattern(s)." - "(5,4--5,10): This runtime coercion or type test from type 'a to int involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." - "(6,4--6,10): This runtime coercion or type test from type 'a to int involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." - "(8,29--8,30): This expression was expected to have type 'unit' but here has type 'int'" - "(9,26--9,27): This expression was expected to have type 'unit' but here has type 'int'" - "(10,14--10,15): This expression was expected to have type ''a * 'b' but here has type 'int'" - "(15,4--15,5): The pattern discriminator 'r' is not defined." + "(10,7--10,9): Unexpected keyword 'as' in binding"; + "(10,5--10,6): Expecting pattern"; + "(11,10--11,12): Unexpected keyword 'as' in binding. Expected '=' or other token."; + "(12,9--12,11): Unexpected keyword 'as' in binding"; + "(13,8--13,10): Unexpected keyword 'as' in binding"; + "(14,8--14,10): Unexpected keyword 'as' in binding"; + "(15,8--15,10): Unexpected keyword 'as' in pattern. Expected ')' or other token."; + "(15,6--15,7): Unmatched '('"; + "(16,0--16,3): Possible incorrect indentation: this token is offside of context started at position (15:1). Try indenting this token further or using standard formatting conventions."; + "(16,0--16,3): Unexpected keyword 'let' or 'use' in binding. Expected incomplete structured construct at or before this point or other token."; + "(15,0--15,3): Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword."; + "(17,0--17,3): Incomplete structured construct at or before this point in implementation file"; + "(20,0--20,0): Possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this token further or using standard formatting conventions."; + "(20,0--20,0): Possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this token further or using standard formatting conventions."; + "(3,13--3,17): This expression was expected to have type\u001d 'int' \u001dbut here has type\u001d 'bool'"; + "(3,4--3,10): Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s)."; + "(4,16--4,17): This expression was expected to have type\u001d 'bool' \u001dbut here has type\u001d 'int'"; + "(4,4--4,13): Incomplete pattern matches on this expression. For example, the value 'false' may indicate a case not covered by the pattern(s)."; + "(5,4--5,10): This runtime coercion or type test from type\u001d 'a \u001d to \u001d int \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(6,4--6,10): This runtime coercion or type test from type\u001d 'a \u001d to \u001d int \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(8,29--8,30): This expression was expected to have type\u001d 'unit' \u001dbut here has type\u001d 'int'"; + "(9,26--9,27): This expression was expected to have type\u001d 'unit' \u001dbut here has type\u001d 'int'"; + "(10,14--10,15): This expression was expected to have type\u001d ''a * 'b' \u001dbut here has type\u001d 'int'"; + "(15,4--15,5): The pattern discriminator 'r' is not defined."; "(15,4--15,12): Incomplete pattern matches on this expression." ] @@ -795,17 +794,17 @@ Some x |> eq """ assertHasSymbolUsages (List.map string ['a'..'z']) checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(11,25--11,26): This expression was expected to have type 'int' but here has type 'obj'" - "(28,6--28,24): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(26,6--26,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(24,6--24,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(22,6--22,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(20,6--20,21): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(18,6--18,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(16,6--16,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(14,6--14,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(12,6--12,14): Incomplete pattern matches on this expression. For example, the value '(``some-other-subtype``,_)' may indicate a case not covered by the pattern(s)." - "(10,6--10,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." + "(11,25--11,26): This expression was expected to have type\u001d 'int' \u001dbut here has type\u001d 'obj'"; + "(28,6--28,24): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(26,6--26,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(24,6--24,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(22,6--22,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(20,6--20,21): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(18,6--18,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(16,6--16,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(14,6--14,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(12,6--12,14): Incomplete pattern matches on this expression. For example, the value '(``some-other-subtype``,_)' may indicate a case not covered by the pattern(s)."; + "(10,6--10,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; "(8,6--8,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." ] @@ -914,34 +913,34 @@ let :? x as () = y let :? z as """ dumpDiagnostics checkResults |> shouldEqual [ - "(10,12--10,13): Unexpected symbol ',' in binding" - "(11,12--11,13): Unexpected symbol ':' in binding" - "(12,12--12,14): Unexpected symbol '::' in binding" - "(13,12--13,13): Unexpected symbol '&' in binding" - "(14,12--14,13): Unexpected symbol '|' in binding" - "(15,16--15,17): Unexpected symbol '=' in pattern. Expected ')' or other token." - "(15,12--15,13): Unmatched '('" - "(16,0--16,3): Possible incorrect indentation: this token is offside of context started at position (15:1). Try indenting this token further or using standard formatting conventions." - "(17,19--17,20): Unexpected identifier in pattern. Expected '(' or other token." - "(20,0--20,0): Incomplete structured construct at or before this point in binding" - "(3,7--3,8): The type 'a' is not defined." - "(3,4--3,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." - "(4,7--4,8): The type 'b' is not defined." - "(4,4--4,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." - "(5,7--5,8): The type 'c' is not defined." - "(5,4--5,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." - "(6,7--6,8): The type 'd' is not defined." - "(6,4--6,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." - "(7,7--7,8): The type 'e' is not defined." - "(7,4--7,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." - "(8,7--8,8): The type 'f' is not defined." - "(8,4--8,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." - "(9,7--9,8): The type 'g' is not defined." - "(9,4--9,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." - "(15,7--15,8): The type 'r' is not defined." - "(15,4--15,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." - "(18,7--18,8): The type 'x' is not defined." - "(18,4--18,8): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." + "(10,12--10,13): Unexpected symbol ',' in binding"; + "(11,12--11,13): Unexpected symbol ':' in binding"; + "(12,12--12,14): Unexpected symbol '::' in binding"; + "(13,12--13,13): Unexpected symbol '&' in binding"; + "(14,12--14,13): Unexpected symbol '|' in binding"; + "(15,16--15,17): Unexpected symbol '=' in pattern. Expected ')' or other token."; + "(15,12--15,13): Unmatched '('"; + "(16,0--16,3): Possible incorrect indentation: this token is offside of context started at position (15:1). Try indenting this token further or using standard formatting conventions."; + "(17,19--17,20): Unexpected identifier in pattern. Expected '(' or other token."; + "(20,0--20,0): Incomplete structured construct at or before this point in binding"; + "(3,7--3,8): The type 'a' is not defined."; + "(3,4--3,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(4,7--4,8): The type 'b' is not defined."; + "(4,4--4,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(5,7--5,8): The type 'c' is not defined."; + "(5,4--5,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(6,7--6,8): The type 'd' is not defined."; + "(6,4--6,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(7,7--7,8): The type 'e' is not defined."; + "(7,4--7,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(8,7--8,8): The type 'f' is not defined."; + "(8,4--8,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(9,7--9,8): The type 'g' is not defined."; + "(9,4--9,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(15,7--15,8): The type 'r' is not defined."; + "(15,4--15,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(18,7--18,8): The type 'x' is not defined."; + "(18,4--18,8): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." ] [] @@ -987,20 +986,20 @@ Some "" |> eq // No more type checks after the above line? """ assertHasSymbolUsages (Set.toList validSet) checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(27,2--27,14): This expression was expected to have type 'obj' but here has type 'struct ('a * 'b)'" - "(52,2--52,13): This expression was expected to have type 'obj' but here has type 'AAA'" - "(26,6--26,24): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(24,6--24,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(22,6--22,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(20,6--20,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(18,6--18,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(16,6--16,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(14,6--14,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(12,6--12,14): Incomplete pattern matches on this expression. For example, the value '(``some-other-subtype``,_)' may indicate a case not covered by the pattern(s)." - "(10,6--10,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." + "(27,2--27,14): This expression was expected to have type\u001d 'obj' \u001dbut here has type\u001d 'struct ('a * 'b)'"; + "(52,2--52,13): This expression was expected to have type\u001d 'obj' \u001dbut here has type\u001d 'AAA'"; + "(26,6--26,24): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(24,6--24,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(22,6--22,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(20,6--20,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(18,6--18,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(16,6--16,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(14,6--14,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(12,6--12,14): Incomplete pattern matches on this expression. For example, the value '(``some-other-subtype``,_)' may indicate a case not covered by the pattern(s)."; + "(10,6--10,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; "(8,6--8,11): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." ] - + [] #if !NETCOREAPP [] @@ -1072,26 +1071,26 @@ Some "" |> eq """ assertHasSymbolUsages (set ['a'..'y'] - set [ 'm'..'r' ] |> Set.map string |> Set.toList) checkResults dumpDiagnostics checkResults |> shouldEqual [ - "(19,2--19,4): This expression was expected to have type 'obj' but here has type 'int'" - "(21,2--21,7): This expression was expected to have type 'obj' but here has type 'bool'" - "(23,2--23,6): This expression was expected to have type 'obj' but here has type 'bool'" - "(28,28--28,29): The type 'obj' does not match the type 'int'" - "(41,5--41,6): The value or constructor 'm' is not defined." - "(42,5--42,6): The value or constructor 'n' is not defined." - "(43,5--43,6): The value or constructor 'o' is not defined." - "(44,5--44,6): The value or constructor 'p' is not defined." - "(45,5--45,6): The value or constructor 'q' is not defined." - "(46,5--46,6): The value or constructor 'r' is not defined." - "(55,12--55,31): The type 'int' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion." - "(26,6--26,14): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(24,6--24,14): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(22,6--22,14): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(20,6--20,15): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(18,6--18,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)." - "(16,6--16,11): Incomplete pattern matches on this expression." - "(14,6--14,11): Incomplete pattern matches on this expression." - "(12,6--12,11): Incomplete pattern matches on this expression." - "(10,6--10,11): Incomplete pattern matches on this expression." + "(19,2--19,4): This expression was expected to have type\u001d 'obj' \u001dbut here has type\u001d 'int'"; + "(21,2--21,7): This expression was expected to have type\u001d 'obj' \u001dbut here has type\u001d 'bool'"; + "(23,2--23,6): This expression was expected to have type\u001d 'obj' \u001dbut here has type\u001d 'bool'"; + "(28,28--28,29): The type 'obj' does not match the type 'int'"; + "(41,5--41,6): The value or constructor 'm' is not defined."; + "(42,5--42,6): The value or constructor 'n' is not defined."; + "(43,5--43,6): The value or constructor 'o' is not defined."; + "(44,5--44,6): The value or constructor 'p' is not defined."; + "(45,5--45,6): The value or constructor 'q' is not defined."; + "(46,5--46,6): The value or constructor 'r' is not defined."; + "(55,12--55,31): The type 'int' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion."; + "(26,6--26,14): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(24,6--24,14): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(22,6--22,14): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(20,6--20,15): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(18,6--18,12): Incomplete pattern matches on this expression. For example, the value '``some-other-subtype``' may indicate a case not covered by the pattern(s)."; + "(16,6--16,11): Incomplete pattern matches on this expression."; + "(14,6--14,11): Incomplete pattern matches on this expression."; + "(12,6--12,11): Incomplete pattern matches on this expression."; + "(10,6--10,11): Incomplete pattern matches on this expression."; "(8,6--8,20): Incomplete pattern matches on this expression. For example, the value '[``some-other-subtype``]' may indicate a case not covered by the pattern(s)." ] @@ -1121,40 +1120,40 @@ let () as :? x = y let as :? z = """ dumpDiagnostics checkResults |> shouldEqual [ - "(10,7--10,9): Unexpected keyword 'as' in binding" - "(10,5--10,6): Expecting pattern" - "(11,10--11,12): Unexpected keyword 'as' in binding. Expected '=' or other token." - "(12,9--12,11): Unexpected keyword 'as' in binding" - "(13,8--13,10): Unexpected keyword 'as' in binding" - "(14,8--14,10): Unexpected keyword 'as' in binding" - "(15,13--15,15): Unexpected keyword 'as' in pattern. Expected '(' or other token." - "(16,8--16,10): Unexpected keyword 'as' in pattern. Expected ')' or other token." - "(16,6--16,7): Unmatched '('" - "(17,0--17,3): Possible incorrect indentation: this token is offside of context started at position (16:1). Try indenting this token further or using standard formatting conventions." - "(17,0--17,3): Unexpected keyword 'let' or 'use' in binding. Expected incomplete structured construct at or before this point or other token." - "(16,0--16,3): Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword." - "(17,8--17,10): Unexpected keyword 'as' in pattern. Expected ']' or other token." - "(18,0--18,3): Possible incorrect indentation: this token is offside of context started at position (17:1). Try indenting this token further or using standard formatting conventions." - "(19,0--19,3): Possible incorrect indentation: this token is offside of context started at position (18:1). Try indenting this token further or using standard formatting conventions." - "(20,0--20,0): Possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this token further or using standard formatting conventions." - "(20,0--20,0): Possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this token further or using standard formatting conventions." - "(3,12--3,13): The type 'a' is not defined." - "(3,9--3,13): The type 'int' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion." - "(4,15--4,16): The type 'b' is not defined." - "(4,12--4,16): The type 'bool' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion." - "(5,4--5,10): This runtime coercion or type test from type 'a to int involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." - "(6,4--6,10): This runtime coercion or type test from type 'a to int involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." - "(7,27--7,28): The type 'e' is not defined." - "(7,24--7,28): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." - "(8,28--8,29): The type 'f' is not defined." - "(8,25--8,29): The type 'unit' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion." - "(9,25--9,26): The type 'g' is not defined." - "(9,22--9,26): The type 'unit' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion." - "(10,13--10,14): The type 'i' is not defined." - "(10,10--10,14): The type ''a * 'b' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion." - "(16,4--16,5): The pattern discriminator 't' is not defined." - "(16,14--16,15): The type 'u' is not defined." - "(16,11--16,15): This runtime coercion or type test from type 'a to 'b involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." + "(10,7--10,9): Unexpected keyword 'as' in binding"; + "(10,5--10,6): Expecting pattern"; + "(11,10--11,12): Unexpected keyword 'as' in binding. Expected '=' or other token."; + "(12,9--12,11): Unexpected keyword 'as' in binding"; + "(13,8--13,10): Unexpected keyword 'as' in binding"; + "(14,8--14,10): Unexpected keyword 'as' in binding"; + "(15,13--15,15): Unexpected keyword 'as' in pattern. Expected '(' or other token."; + "(16,8--16,10): Unexpected keyword 'as' in pattern. Expected ')' or other token."; + "(16,6--16,7): Unmatched '('"; + "(17,0--17,3): Possible incorrect indentation: this token is offside of context started at position (16:1). Try indenting this token further or using standard formatting conventions."; + "(17,0--17,3): Unexpected keyword 'let' or 'use' in binding. Expected incomplete structured construct at or before this point or other token."; + "(16,0--16,3): Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword."; + "(17,8--17,10): Unexpected keyword 'as' in pattern. Expected ']' or other token."; + "(18,0--18,3): Possible incorrect indentation: this token is offside of context started at position (17:1). Try indenting this token further or using standard formatting conventions."; + "(19,0--19,3): Possible incorrect indentation: this token is offside of context started at position (18:1). Try indenting this token further or using standard formatting conventions."; + "(20,0--20,0): Possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this token further or using standard formatting conventions."; + "(20,0--20,0): Possible incorrect indentation: this token is offside of context started at position (19:1). Try indenting this token further or using standard formatting conventions."; + "(3,12--3,13): The type 'a' is not defined."; + "(3,9--3,13): The type 'int' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion."; + "(4,15--4,16): The type 'b' is not defined."; + "(4,12--4,16): The type 'bool' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion."; + "(5,4--5,10): This runtime coercion or type test from type\u001d 'a \u001d to \u001d int \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(6,4--6,10): This runtime coercion or type test from type\u001d 'a \u001d to \u001d int \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(7,27--7,28): The type 'e' is not defined."; + "(7,24--7,28): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed."; + "(8,28--8,29): The type 'f' is not defined."; + "(8,25--8,29): The type 'unit' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion."; + "(9,25--9,26): The type 'g' is not defined."; + "(9,22--9,26): The type 'unit' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion."; + "(10,13--10,14): The type 'i' is not defined."; + "(10,10--10,14): The type ''a * 'b' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion."; + "(16,4--16,5): The pattern discriminator 't' is not defined."; + "(16,14--16,15): The type 'u' is not defined."; + "(16,11--16,15): This runtime coercion or type test from type\u001d 'a \u001d to \u001d 'b \u001dinvolves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed." ] [] diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs index eca70a6bd89..1ca8e79fdf8 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs @@ -207,13 +207,7 @@ let g (t : T) = t.Count() X(1.0) """ - let expectedMessages = [ """No overloads match for method 'X'. - -Known type of argument: float - -Available overloads: - - new: bool -> X // Argument at index 1 doesn't match - - new: int -> X // Argument at index 1 doesn't match""" ] + let expectedMessages = [ "No overloads match for method 'X'.\u001d\u001dKnown type of argument: float\u001d\u001dAvailable overloads:\u001d - new: bool -> X // Argument at index 1 doesn't match\u001d - new: int -> X // Argument at index 1 doesn't match" ] CheckErrorList content (assertExpectedErrorMessages expectedMessages) @@ -292,15 +286,7 @@ let x = let content = """ System.Console.WriteLine(null) """ - let expectedMessages = [ """A unique overload for method 'WriteLine' could not be determined based on type information prior to this program point. A type annotation may be needed. - -Known type of argument: 'a0 when 'a0: null - -Candidates: - - System.Console.WriteLine(buffer: char array) : unit - - System.Console.WriteLine(format: string, [] arg: obj array) : unit - - System.Console.WriteLine(value: obj) : unit - - System.Console.WriteLine(value: string) : unit""" ] + let expectedMessages = [ "A unique overload for method 'WriteLine' could not be determined based on type information prior to this program point. A type annotation may be needed.\u001d\u001dKnown type of argument: 'a0 when 'a0: null\u001d\u001dCandidates:\u001d - System.Console.WriteLine(buffer: char array) : unit\u001d - System.Console.WriteLine(format: string, [] arg: obj array) : unit\u001d - System.Console.WriteLine(value: obj) : unit\u001d - System.Console.WriteLine(value: string) : unit" ] CheckErrorList content (assertExpectedErrorMessages expectedMessages) [] @@ -315,13 +301,7 @@ type B() = let b = B() b.Do(1, 1) """ - let expectedMessages = [ """A unique overload for method 'Do' could not be determined based on type information prior to this program point. A type annotation may be needed. - -Known types of arguments: int * int - -Candidates: - - member A.Do: a: int * b: 'T -> unit - - member A.Do: a: int * b: int -> unit""" ] + let expectedMessages = [ "A unique overload for method 'Do' could not be determined based on type information prior to this program point. A type annotation may be needed.\u001d\u001dKnown types of arguments: int * int\u001d\u001dCandidates:\u001d - member A.Do: a: int * b: 'T -> unit\u001d - member A.Do: a: int * b: int -> unit" ] CheckErrorList content (assertExpectedErrorMessages expectedMessages) [] @@ -472,10 +452,7 @@ type staticInInterface = // dummy Type Provider exposes a parametric type (N1.T) that takes 2 static params (string * int) // but here as you can see it's give (int * int) let fileContent = """ type foo = N1.T< const 42,2>""" - let expectedStr = """This expression was expected to have type - 'string' -but here has type - 'int' """ + let expectedStr = "This expression was expected to have type\u001d 'string' \u001dbut here has type\u001d 'int'" this.VerifyErrorListContainedExpectedString(fileContent,expectedStr, addtlRefAssy = [PathRelativeToTestAssembly(@"DummyProviderForLanguageServiceTesting.dll")]) diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 15c15bf400b..5510d3dcb9c 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -57,9 +57,9 @@ - - CompilerService\DocCommentIdParserTests.fs - + + CompilerService\DocCommentIdParserTests.fs + CompilerService\UnusedOpensTests.fs