diff --git a/src/Compiler/Checking/CheckExpressions.fs b/src/Compiler/Checking/CheckExpressions.fs
index ade040f1ed6..2decf1d668c 100644
--- a/src/Compiler/Checking/CheckExpressions.fs
+++ b/src/Compiler/Checking/CheckExpressions.fs
@@ -10535,7 +10535,20 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt
let envinner = {envinner with eCallerMemberName = callerName }
- let attrTgt = declKind.AllowedAttribTargets memberFlagsOpt
+ let attrTgt =
+ if g.langVersion.SupportsFeature(LanguageFeature.EnforceAttributeTargetsOnLetValues) then
+ match pat, rhsExpr with
+ | SynPat.Named _ , SynExpr.Lambda _
+ | SynPat.Named _ , SynExpr.App _
+ | SynPat.Named _ , SynExpr.MatchLambda _ -> AttributeTargets.Method ||| AttributeTargets.ReturnValue
+ | SynPat.Named _, _ when not declaredTypars.IsEmpty -> AttributeTargets.Method ||| AttributeTargets.ReturnValue
+ | SynPat.Named _ , SynExpr.Ident(ident = ident) when ident.idText = "id" -> AttributeTargets.Method ||| AttributeTargets.ReturnValue
+
+ | SynPat.Tuple _ , _
+ | SynPat.Named _, _ when isNil declaredTypars -> AttributeTargets.FieldDecl
+ | _ -> declKind.AllowedAttribTargets memberFlagsOpt
+ else
+ declKind.AllowedAttribTargets memberFlagsOpt
let isFixed, rhsExpr, overallPatTy, overallExprTy =
match rhsExpr with
@@ -10815,7 +10828,7 @@ and TcNonRecursiveBinding declKind cenv env tpenv ty binding =
warning(Error(FSComp.SR.tcInfoIfFunctionShadowsUnionCase(), headPatRange))
| _ -> ()
| _ -> ()
-
+
let binding = BindingNormalization.NormalizeBinding ValOrMemberBinding cenv env binding
let explicitTyparInfo, tpenv = TcNonrecBindingTyparDecls cenv env tpenv binding
TcNormalizedBinding declKind cenv env tpenv ty None NoSafeInitInfo ([], explicitTyparInfo) binding
diff --git a/src/Compiler/Checking/TailCallChecks.fs b/src/Compiler/Checking/TailCallChecks.fs
index 1faa9a50a35..b8f697ded37 100644
--- a/src/Compiler/Checking/TailCallChecks.fs
+++ b/src/Compiler/Checking/TailCallChecks.fs
@@ -733,13 +733,8 @@ let CheckModuleBinding cenv (isRec: bool) (TBind _ as bind) =
cenv.reportErrors
&& cenv.g.langVersion.SupportsFeature LanguageFeature.WarningWhenTailCallAttrOnNonRec
then
- let isNotAFunction =
- match bind.Var.ValReprInfo with
- | Some info -> info.HasNoArgs
- | _ -> false
-
if
- (not isRec || isNotAFunction)
+ not isRec
&& HasFSharpAttribute cenv.g cenv.g.attrib_TailCallAttribute bind.Var.Attribs
then
warning (Error(FSComp.SR.chkTailCallAttrOnNonRec (), bind.Var.Range))
diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt
index fd3b780aacf..f5ab14caa24 100644
--- a/src/Compiler/FSComp.txt
+++ b/src/Compiler/FSComp.txt
@@ -1588,6 +1588,7 @@ featureChkNotTailRecursive,"Raises warnings if a member or function has the 'Tai
featureWhileBang,"'while!' expression"
featureExtendedFixedBindings,"extended fixed bindings for byref and GetPinnableReference"
featurePreferStringGetPinnableReference,"prefer String.GetPinnableReference in fixed bindings"
+featureEnforceAttributeTargetsOnLetValues,"Enforce AttributeTargets on let values"
featurePreferExtensionMethodOverPlainProperty,"prefer extension method over plain property"
featureWarningIndexedPropertiesGetSetSameType,"Indexed properties getter and setter must have the same type"
featureChkTailCallAttrOnNonRec,"Raises warnings if the 'TailCall' attribute is used on non-recursive functions."
diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs
index 47c99af3ba7..ffa4dd50bbe 100644
--- a/src/Compiler/Facilities/LanguageFeatures.fs
+++ b/src/Compiler/Facilities/LanguageFeatures.fs
@@ -80,6 +80,7 @@ type LanguageFeature =
| ReuseSameFieldsInStructUnions
| ExtendedFixedBindings
| PreferStringGetPinnableReference
+ | EnforceAttributeTargetsOnLetValues
| PreferExtensionMethodOverPlainProperty
| WarningIndexedPropertiesGetSetSameType
| WarningWhenTailCallAttrOnNonRec
@@ -189,6 +190,7 @@ type LanguageVersion(versionText) =
// F# preview
LanguageFeature.FromEndSlicing, previewVersion
LanguageFeature.UnmanagedConstraintCsharpInterop, previewVersion
+ LanguageFeature.EnforceAttributeTargetsOnLetValues, previewVersion
LanguageFeature.ReuseSameFieldsInStructUnions, previewVersion
LanguageFeature.PreferExtensionMethodOverPlainProperty, previewVersion
LanguageFeature.WarningIndexedPropertiesGetSetSameType, previewVersion
@@ -330,6 +332,7 @@ type LanguageVersion(versionText) =
| LanguageFeature.ReuseSameFieldsInStructUnions -> FSComp.SR.featureReuseSameFieldsInStructUnions ()
| LanguageFeature.ExtendedFixedBindings -> FSComp.SR.featureExtendedFixedBindings ()
| LanguageFeature.PreferStringGetPinnableReference -> FSComp.SR.featurePreferStringGetPinnableReference ()
+ | LanguageFeature.EnforceAttributeTargetsOnLetValues -> FSComp.SR.featureEnforceAttributeTargetsOnLetValues ()
| LanguageFeature.PreferExtensionMethodOverPlainProperty -> FSComp.SR.featurePreferExtensionMethodOverPlainProperty ()
| LanguageFeature.WarningIndexedPropertiesGetSetSameType -> FSComp.SR.featureWarningIndexedPropertiesGetSetSameType ()
| LanguageFeature.WarningWhenTailCallAttrOnNonRec -> FSComp.SR.featureChkTailCallAttrOnNonRec ()
diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi
index f444db4bb4f..5718ff5392a 100644
--- a/src/Compiler/Facilities/LanguageFeatures.fsi
+++ b/src/Compiler/Facilities/LanguageFeatures.fsi
@@ -70,6 +70,7 @@ type LanguageFeature =
| ReuseSameFieldsInStructUnions
| ExtendedFixedBindings
| PreferStringGetPinnableReference
+ | EnforceAttributeTargetsOnLetValues
/// RFC-1137
| PreferExtensionMethodOverPlainProperty
| WarningIndexedPropertiesGetSetSameType
diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf
index 147cbedd0bc..5b7558b665f 100644
--- a/src/Compiler/xlf/FSComp.txt.cs.xlf
+++ b/src/Compiler/xlf/FSComp.txt.cs.xlf
@@ -282,6 +282,11 @@
literál float32 bez tečky
+
+ Enforce AttributeTargets on let values
+ Enforce AttributeTargets on let values
+
+ Raises errors for non-virtual members overridesVyvolá chyby pro přepsání jiných než virtuálních členů
diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf
index 1f10dbed592..ef7c5d6c219 100644
--- a/src/Compiler/xlf/FSComp.txt.de.xlf
+++ b/src/Compiler/xlf/FSComp.txt.de.xlf
@@ -282,6 +282,11 @@
punktloses float32-Literal
+
+ Enforce AttributeTargets on let values
+ Enforce AttributeTargets on let values
+
+ Raises errors for non-virtual members overridesLöst Fehler für Außerkraftsetzungen nicht virtueller Member aus.
diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf
index c92fb6d96f1..adaef98846b 100644
--- a/src/Compiler/xlf/FSComp.txt.es.xlf
+++ b/src/Compiler/xlf/FSComp.txt.es.xlf
@@ -282,6 +282,11 @@
literal float32 sin punto
+
+ Enforce AttributeTargets on let values
+ Enforce AttributeTargets on let values
+
+ Raises errors for non-virtual members overridesGenera errores para invalidaciones de miembros no virtuales
diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf
index 29621977a64..07ed59314fc 100644
--- a/src/Compiler/xlf/FSComp.txt.fr.xlf
+++ b/src/Compiler/xlf/FSComp.txt.fr.xlf
@@ -282,6 +282,11 @@
littéral float32 sans point
+
+ Enforce AttributeTargets on let values
+ Enforce AttributeTargets on let values
+
+ Raises errors for non-virtual members overridesDéclenche des erreurs pour les remplacements de membres non virtuels
diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf
index a0edd202be0..0101df95d05 100644
--- a/src/Compiler/xlf/FSComp.txt.it.xlf
+++ b/src/Compiler/xlf/FSComp.txt.it.xlf
@@ -282,6 +282,11 @@
valore letterale float32 senza punti
+
+ Enforce AttributeTargets on let values
+ Enforce AttributeTargets on let values
+
+ Raises errors for non-virtual members overridesGenera errori per gli override dei membri non virtuali
diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf
index 9181e17a428..f3d7824c9e1 100644
--- a/src/Compiler/xlf/FSComp.txt.ja.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ja.xlf
@@ -282,6 +282,11 @@
ドットなしの float32 リテラル
+
+ Enforce AttributeTargets on let values
+ Enforce AttributeTargets on let values
+
+ Raises errors for non-virtual members overrides仮想メンバー以外のオーバーライドに対してエラーを発生させます
diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf
index 0f11ea8327b..c249e726a01 100644
--- a/src/Compiler/xlf/FSComp.txt.ko.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ko.xlf
@@ -282,6 +282,11 @@
점이 없는 float32 리터럴
+
+ Enforce AttributeTargets on let values
+ Enforce AttributeTargets on let values
+
+ Raises errors for non-virtual members overrides비가상 멤버 재정의에 대한 오류 발생
diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf
index 2b86aba00a2..80f6ca3018b 100644
--- a/src/Compiler/xlf/FSComp.txt.pl.xlf
+++ b/src/Compiler/xlf/FSComp.txt.pl.xlf
@@ -282,6 +282,11 @@
bezkropkowy literał float32
+
+ Enforce AttributeTargets on let values
+ Enforce AttributeTargets on let values
+
+ Raises errors for non-virtual members overridesZgłasza błędy w przypadku przesłonięć elementów innych niż wirtualne
diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
index 35d75d2ccfe..39e5f0766a4 100644
--- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
+++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
@@ -282,6 +282,11 @@
literal float32 sem ponto
+
+ Enforce AttributeTargets on let values
+ Enforce AttributeTargets on let values
+
+ Raises errors for non-virtual members overridesGera erros para substituições de membros não virtuais
diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf
index 75f88701d3c..63364ebc906 100644
--- a/src/Compiler/xlf/FSComp.txt.ru.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ru.xlf
@@ -282,6 +282,11 @@
литерал float32 без точки
+
+ Enforce AttributeTargets on let values
+ Enforce AttributeTargets on let values
+
+ Raises errors for non-virtual members overridesВызывает ошибки при переопределениях невиртуальных элементов
diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf
index 417320ad230..cc2ec431f8f 100644
--- a/src/Compiler/xlf/FSComp.txt.tr.xlf
+++ b/src/Compiler/xlf/FSComp.txt.tr.xlf
@@ -282,6 +282,11 @@
noktasız float32 sabit değeri
+
+ Enforce AttributeTargets on let values
+ Enforce AttributeTargets on let values
+
+ Raises errors for non-virtual members overridesSanal olmayan üyelerde geçersiz kılmalar için hatalar oluştur
diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
index f116c2f1a78..d353a1b10fb 100644
--- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
+++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
@@ -282,6 +282,11 @@
无点 float32 文本
+
+ Enforce AttributeTargets on let values
+ Enforce AttributeTargets on let values
+
+ Raises errors for non-virtual members overrides引发非虚拟成员替代的错误
diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
index 8decd4ee8f6..318bae001c9 100644
--- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
+++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
@@ -282,6 +282,11 @@
無點號的 float32 常值
+
+ Enforce AttributeTargets on let values
+ Enforce AttributeTargets on let values
+
+ Raises errors for non-virtual members overrides引發非虛擬成員覆寫的錯誤
diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeTargetsIsMethod02.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeTargetsIsMethod02.fs
new file mode 100644
index 00000000000..7280f2abbc0
--- /dev/null
+++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeTargetsIsMethod02.fs
@@ -0,0 +1,103 @@
+// #Regression #Conformance #DeclarationElements #Attributes
+// Regression test for FSharp1.0:5172
+// Title: "method" attribute target is not recognized
+// Descr: Verify that attribute target 'method' is recognized by F# compiler correctly.
+open System
+
+[]
+type MethodOnlyAttribute() =
+ inherit Attribute()
+
+[]
+let someValue = "someValue" // Should fail
+
+[]
+let i, j, k = (1, 2, 3) // Should fail
+
+[]
+let someFunction () = "someFunction"
+
+[]
+let someFunction2 a = a + 1
+
+[]
+let someFunction3 (a, b) = a + b
+
+[]
+let someFunction4 (a: int) : int = a + 1
+
+[]
+let makeList a b = [ a; b ]
+
+[]
+let someTypedFunction<'a> = "someTypedFunction"
+
+[]
+let someTypedFunction2<'a> (x : 'a) = "someTypedFunction2"
+
+[]
+let someTypedFunction3 = fun x -> x
+
+[]
+let someTypedFunction4 = id
+
+[]
+let __someTypedFunction5<'a> = false
+
+[]
+let __someTypedFunction6<'a> : bool = false
+
+[]
+let ``someValue2`` = "someValue" // Should fail
+
+type TestConst =
+ | Bool of bool
+
+[]
+type TestExpr =
+ | Const of TestConst * Type * int
+ | Var of string * Type * int
+
+[]
+let (|BoolExpr|_|) =
+ function
+ | TestExpr.Const (TestConst.Bool b, _, _) -> Some b
+ | _ -> None
+
+[]
+[]
+let (|BoolExpr2|_|) =
+ function
+ | TestExpr.Const(TestConst.Bool b1, _, _) -> ValueSome b1
+ | _ -> ValueNone
+
+[]
+let (|BoolExpr3|_|) x =
+ match x with
+ | TestExpr.Const (TestConst.Bool b, _, _) -> Some b
+ | _ -> None
+
+[]
+[]
+let (|BoolExpr4|_|) x =
+ match x with
+ | TestExpr.Const(TestConst.Bool b1, _, _) -> ValueSome b1
+ | _ -> ValueNone
+
+let private dangling (target: TestExpr -> TestExpr voption) =
+ function
+ | TestExpr.Const (TestConst.Bool _, _, _) as b -> ValueSome b
+ | _ -> ValueNone
+
+[]
+[]
+let (|IfThen|_|) =
+ dangling (function
+ | TestExpr.Const(TestConst.Bool b1, _, _) as expr -> ValueSome expr
+ | _ -> ValueNone)
+
+[]
+let someRecLetBoundValue = nameof(MethodOnlyAttribute) // Should fail
+
+[]
+let rec someRecLetBoundValue2 = nameof(someRecLetBoundValue2) // Should fail
\ No newline at end of file
diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs
index cddee9f80ab..56af7f9f0ac 100644
--- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs
+++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/CustomAttributes/AttributeUsage/AttributeUsage.fs
@@ -63,6 +63,34 @@ module CustomAttributes_AttributeUsage =
compilation
|> verifyCompileAndRun
|> shouldSucceed
+
+ // SOURCE=AttributeTargetsIsMethod01.fs # AttributeTargetsIsMethod01.fs
+ []
+ let ``AttributeTargetsIsMethod01_fs preview`` compilation =
+ compilation
+ |> withLangVersionPreview
+ |> verifyCompileAndRun
+ |> shouldSucceed
+
+ // SOURCE=AttributeTargetsIsMethod02.fs # AttributeTargetsIsMethod02.fs
+ []
+ let ``AttributeTargetsIsMethod02_fs`` compilation =
+ compilation
+ |> verifyCompileAndRun
+ |> shouldSucceed
+
+ // SOURCE=AttributeTargetsIsMethod02.fs # AttributeTargetsIsMethod02.fs
+ []
+ let ``AttributeTargetsIsMethod02_fs preview lang`` compilation =
+ compilation
+ |> withLangVersionPreview
+ |> verifyCompile
+ |> shouldFail
+ |> withDiagnostics [
+ (Error 842, Line 11, Col 3, Line 11, Col 13, "This attribute is not valid for use on this language element")
+ (Error 842, Line 14, Col 3, Line 14, Col 13, "This attribute is not valid for use on this language element")
+ (Error 842, Line 50, Col 3, Line 50, Col 13, "This attribute is not valid for use on this language element")
+ ]
// SOURCE=ConditionalAttribute.fs # ConditionalAttribute.fs
[]
@@ -82,7 +110,21 @@ module CustomAttributes_AttributeUsage =
(Error 842, Line 24, Col 21, Line 24, Col 29, "This attribute is not valid for use on this language element")
(Error 842, Line 27, Col 7, Line 27, Col 16, "This attribute is not valid for use on this language element")
]
-
+
+ // SOURCE=E_AttributeTargets01.fs # E_AttributeTargets01.fs
+ []
+ let ``E_AttributeTargets01_fs preview`` compilation =
+ compilation
+ |> withLangVersionPreview
+ |> verifyCompile
+ |> shouldFail
+ |> withDiagnostics [
+ (Error 842, Line 21, Col 21, Line 21, Col 22, "This attribute is not valid for use on this language element");
+ (Error 842, Line 24, Col 21, Line 24, Col 29, "This attribute is not valid for use on this language element");
+ (Error 842, Line 27, Col 7, Line 27, Col 16, "This attribute is not valid for use on this language element");
+ (Error 842, Line 18, Col 7, Line 18, Col 8, "This attribute is not valid for use on this language element")
+ ]
+
// SOURCE=E_AttributeTargets02.fs # E_AttributeTargets02.fs
[]
let ``E_AttributeTargets02_fs`` compilation =
@@ -94,6 +136,18 @@ module CustomAttributes_AttributeUsage =
(Error 842, Line 24, Col 7, Line 24, Col 36, "This attribute is not valid for use on this language element")
(Error 842, Line 29, Col 15, Line 29, Col 47, "This attribute is not valid for use on this language element")
]
+
+ // SOURCE=E_AttributeTargets02.fs # E_AttributeTargets02.fs
+ []
+ let ``E_AttributeTargets02_fs preview`` compilation =
+ compilation
+ |> verifyCompile
+ |> shouldFail
+ |> withDiagnostics [
+ (Error 842, Line 14, Col 7, Line 14, Col 34, "This attribute is not valid for use on this language element")
+ (Error 842, Line 24, Col 7, Line 24, Col 36, "This attribute is not valid for use on this language element")
+ (Error 842, Line 29, Col 15, Line 29, Col 47, "This attribute is not valid for use on this language element")
+ ]
// SOURCE=E_ConditionalAttribute.fs SCFLAGS="--test:ErrorRanges" # E_ConditionalAttribute.fs
[]
diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs
index 3366ed91c3f..8399a5b37f6 100644
--- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs
+++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/TailCallAttribute.fs
@@ -1440,7 +1440,7 @@ namespace N
]
[]
- let ``Warn about attribute on non-recursive let-bound value`` () =
+ let ``Error about using attribute with AttributeTargets.Method on non-recursive let-bound value`` () =
"""
namespace N
@@ -1453,18 +1453,10 @@ namespace N
|> withLangVersionPreview
|> compile
|> shouldFail
- |> withResults [
- { Error = Warning 3861
- Range = { StartLine = 7
- StartColumn = 13
- EndLine = 7
- EndColumn = 18 }
- Message =
- "The TailCall attribute should only be applied to recursive functions." }
- ]
+ |> withSingleDiagnostic (Error 842, Line 6, Col 11, Line 6, Col 19, "This attribute is not valid for use on this language element")
[]
- let ``Warn about attribute on recursive let-bound value`` () =
+ let ``Error about using attribute with AttributeTargets.Method on recursive let-bound value`` () =
"""
namespace N
@@ -1477,12 +1469,4 @@ namespace N
|> withLangVersionPreview
|> compile
|> shouldFail
- |> withResults [
- { Error = Warning 3861
- Range = { StartLine = 7
- StartColumn = 17
- EndLine = 7
- EndColumn = 37 }
- Message =
- "The TailCall attribute should only be applied to recursive functions." }
- ]
+ |> withSingleDiagnostic (Error 842, Line 6, Col 11, Line 6, Col 19, "This attribute is not valid for use on this language element")
diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs
index d6211dda1dc..35b2a74f2a8 100644
--- a/tests/service/ProjectAnalysisTests.fs
+++ b/tests/service/ProjectAnalysisTests.fs
@@ -4724,17 +4724,17 @@ type TestRecord = { B : int }
module Test =
[)>]
- let withType = 0
+ let withType() = 0
[>)>]
- let withGenericType = 0
+ let withGenericType() = 0
[)>]
- let withTupleType = 0
+ let withTupleType() = 0
[ int>)>]
- let withFuncType = 0
+ let withFuncType() = 0
[; typeof |])>]
- let withTypeArray = 0
+ let withTypeArray() = 0
[]
- let withIntArray = 0
+ let withIntArray() = 0
module NestedModule =
type NestedRecordType = { B : int }
diff --git a/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs b/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs
index e94a5f69436..551b804bc37 100644
--- a/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs
+++ b/vsintegration/tests/FSharp.Editor.Tests/CompletionProviderTests.fs
@@ -423,7 +423,7 @@ xVal**y
Assert.True(triggered, "Completion should trigger after typing an identifier that follows a mathematical operation")
[]
- let ShouldTriggerCompletionAtStartOfFileWithInsertion =
+ let ShouldTriggerCompletionAtStartOfFileWithInsertion () =
let fileContents =
"""
l"""
@@ -888,7 +888,7 @@ type T() =
VerifyNoCompletionList(fileContents, "member this.M(p")
[]
- let ``Completion list on abstract member type signature contains modules and types but not keywords or functions`` =
+ let ``Completion list on abstract member type signature contains modules and types but not keywords or functions`` () =
let fileContents =
"""
type Interface =