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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions tests/fsharp/Compiler/ErrorMessages/DontSuggestTests.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.

namespace FSharp.Compiler.UnitTests

open NUnit.Framework
open FSharp.Compiler.SourceCodeServices

[<TestFixture>]
module ``Don't Suggest`` =

[<Test>]
let ``Dont Suggest Completely Wrong Stuff``() =
CompilerAssert.TypeCheckSingleError
"""
let _ = Path.GetFullPath "images"
"""
FSharpErrorSeverity.Error
39
(2, 9, 2, 13)
"The value, namespace, type or module 'Path' is not defined."

[<Test>]
let ``Dont Suggest When Things Are Open``() =
CompilerAssert.ParseWithErrors
"""
module N =
let name = "hallo"

type T =
static member myMember = 1

let x = N.
"""
[|
FSharpErrorSeverity.Error, 599, (8, 10, 8, 11), "Missing qualification after '.'"
FSharpErrorSeverity.Error, 222, (2, 1, 3, 1), "Files in libraries or multiple-file applications must begin with a namespace or module declaration. When using a module declaration at the start of a file the '=' sign is not allowed. If this is a top-level module, consider removing the = to resolve this error."
|]

[<Test>]
let ``Dont Suggest Intentionally Unused Variables``() =
CompilerAssert.TypeCheckSingleError
"""
let hober xy _xyz = xyz
"""
FSharpErrorSeverity.Error
39
(2, 21, 2, 24)
"The value or constructor 'xyz' is not defined."
1 change: 1 addition & 0 deletions tests/fsharp/FSharpSuite.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<Compile Include="Compiler\ErrorMessages\UpcastDowncastTests.fs" />
<Compile Include="Compiler\ErrorMessages\AssignmentErrorTests.fs" />
<Compile Include="Compiler\ErrorMessages\WarnExpressionTests.fs" />
<Compile Include="Compiler\ErrorMessages\DontSuggestTests.fs" />
<Compile Include="Compiler\SourceTextTests.fs" />
<Compile Include="Compiler\Language\AnonRecordTests.fs" />
<Compile Include="Compiler\Language\SpanOptimizationTests.fs" />
Expand Down

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions tests/fsharpqa/Source/Warnings/DontSuggestWhenThingsAreOpen.fs

This file was deleted.

3 changes: 0 additions & 3 deletions tests/fsharpqa/Source/Warnings/env.lst
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
SOURCE=SuggestUnionCases.fs SCFLAGS="--vserrors" # SuggestUnionCases.fs
SOURCE=SuggestArrayModuleFunctions.fs SCFLAGS="--vserrors" # SuggestArrayModuleFunctions.fs
SOURCE=SuggestTypesInNamespace.fs # SuggestTypesInNamespace.fs
SOURCE=DontSuggestCompletelyWrongStuff.fs SCFLAGS="--vserrors" # DontSuggestCompletelyWrongStuff.fs
SOURCE=SuggestTypesInNamespaceVS.fs SCFLAGS="--vserrors" # SuggestTypesInNamespaceVS.fs
SOURCE=SuggestAsyncModule.fs SCFLAGS="--vserrors" # SuggestAsyncModule.fs
SOURCE=DontSuggestWhenThingsAreOpen.fs SCFLAGS="--vserrors" # DontSuggestWhenThingsAreOpen.fs
SOURCE=SuggestDoubleBacktickIdentifiers.fs SCFLAGS="--vserrors" # SuggestDoubleBacktickIdentifiers.fs
SOURCE=SuggestDoubleBacktickUnions.fs SCFLAGS="--vserrors" # SuggestDoubleBacktickUnions.fs
SOURCE=MissingExpressionAfterLet.fs # MissingExpressionAfterLet.fs
Expand All @@ -28,4 +26,3 @@
SOURCE=SuggestToUseIndexer.fs # SuggestToUseIndexer.fs
SOURCE=Repro1548.fs SCFLAGS="-r:Repro1548.dll" # Repro1548.fs
SOURCE=ModuleAbbreviationsArePrivate.fs
SOURCE=DontSuggestIntentionallyUnusedVariables.fs SCFLAGS="--vserrors" # DontSuggestIntentionallyUnusedVariables.fs