diff --git a/src/fsharp/CheckExpressions.fs b/src/fsharp/CheckExpressions.fs index 0149709833..1d6d30b108 100644 --- a/src/fsharp/CheckExpressions.fs +++ b/src/fsharp/CheckExpressions.fs @@ -10920,6 +10920,8 @@ and AnalyzeRecursiveDecl bindingAttribs, vis2, tcrefContainerInfo, memberFlagsOpt, ty, bindingRhs, mBinding) + | SynPat.Paren(_, m) -> error(Error(FSComp.SR.tcInvalidMemberDeclNameMissingOrHasParen(), m)) + | _ -> error(Error(FSComp.SR.tcOnlySimplePatternsInLetRec(), mBinding)) analyzeRecursiveDeclPat tpenv declPattern diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index acad18382f..c4d2c7bc64 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1632,3 +1632,4 @@ reprStateMachineInvalidForm,"The state machine has an unexpected form" 3518,implMissingInlineIfLambda,"The 'InlineIfLambda' attribute is present in the signature but not the implementation." 3519,tcInlineIfLambdaUsedOnNonInlineFunctionOrMethod,"The 'InlineIfLambda' attribute may only be used on parameters of inlined functions of methods whose type is a function or F# delegate type." 3520,invalidXmlDocPosition,"XML comment is not placed on a valid language element." +3521,tcInvalidMemberDeclNameMissingOrHasParen,"Invalid member declaration. The name of the member is missing or has parentheses." diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index deeb54bea8..56358ff58e 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -647,6 +647,11 @@ Neplatné zarovnání v interpolovaném řetězci + + Invalid member declaration. The name of the member is missing or has parentheses. + Invalid member declaration. The name of the member is missing or has parentheses. + + The construct '{0}' may only be used in valid resumable code. Konstruktor {0} je možné použít jenom v platném obnovitelném kódu. diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index cd8ae9c7a5..30e88eb106 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -647,6 +647,11 @@ Ungültige Ausrichtung in interpolierter Zeichenfolge. + + Invalid member declaration. The name of the member is missing or has parentheses. + Invalid member declaration. The name of the member is missing or has parentheses. + + The construct '{0}' may only be used in valid resumable code. Das Konstrukt "{0}" darf nur in einem gültigen fortsetzbaren Code verwendet werden. diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index c6a774bff0..60d6a2df32 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -647,6 +647,11 @@ Alineación no válida en la cadena interpolada + + Invalid member declaration. The name of the member is missing or has parentheses. + Invalid member declaration. The name of the member is missing or has parentheses. + + The construct '{0}' may only be used in valid resumable code. La construcción "{0}" solo se puede usar en un código reanudable válido. diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index 6b79cdb846..dff83cd809 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -647,6 +647,11 @@ Alignement non valide dans la chaîne interpolée + + Invalid member declaration. The name of the member is missing or has parentheses. + Invalid member declaration. The name of the member is missing or has parentheses. + + The construct '{0}' may only be used in valid resumable code. La construction «{0}» ne peut être utilisée que dans un code pouvant être repris valide. diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index a32205a3a2..6fe5176763 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -647,6 +647,11 @@ Allineamento non valido nella stringa interpolata + + Invalid member declaration. The name of the member is missing or has parentheses. + Invalid member declaration. The name of the member is missing or has parentheses. + + The construct '{0}' may only be used in valid resumable code. Il costrutto '{0}' può essere usato solo in codice ripristinabile valido. diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index 8abb9f6a30..30c7b04b0e 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -647,6 +647,11 @@ 補間された文字列内の配置が無効です + + Invalid member declaration. The name of the member is missing or has parentheses. + Invalid member declaration. The name of the member is missing or has parentheses. + + The construct '{0}' may only be used in valid resumable code. コンストラクト '{0}' は、有効な再開可能コードでのみ使用できます。 diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 184ed54955..acdf8540ba 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -647,6 +647,11 @@ 보간 문자열의 잘못된 정렬 + + Invalid member declaration. The name of the member is missing or has parentheses. + Invalid member declaration. The name of the member is missing or has parentheses. + + The construct '{0}' may only be used in valid resumable code. '{0}' 구문은 유효한 다시 시작 가능한 코드에서만 사용할 수 있습니다. diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 25c44f08d9..2e4fdfe91a 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -647,6 +647,11 @@ Nieprawidłowe wyrównanie w ciągu interpolowanym + + Invalid member declaration. The name of the member is missing or has parentheses. + Invalid member declaration. The name of the member is missing or has parentheses. + + The construct '{0}' may only be used in valid resumable code. Konstrukcji "{0}" można używać tylko w prawidłowym kodzie z możliwością wznowienia. diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index 132bf3d972..87dfe7978d 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -647,6 +647,11 @@ Alinhamento inválido na cadeia de caracteres interpolada + + Invalid member declaration. The name of the member is missing or has parentheses. + Invalid member declaration. The name of the member is missing or has parentheses. + + The construct '{0}' may only be used in valid resumable code. A construção '{0}' só pode ser usada em código válido e retomável. diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index 72aac1e833..00d4f27cf2 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -647,6 +647,11 @@ Недопустимое выравнивание в интерполированной строке + + Invalid member declaration. The name of the member is missing or has parentheses. + Invalid member declaration. The name of the member is missing or has parentheses. + + The construct '{0}' may only be used in valid resumable code. Конструкция "{0}" может использоваться только в допустимом возобновляемом коде. diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 758bec7b7f..0a0b55e3d4 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -647,6 +647,11 @@ Düz metin arasına kod eklenmiş dizede geçersiz hizalama + + Invalid member declaration. The name of the member is missing or has parentheses. + Invalid member declaration. The name of the member is missing or has parentheses. + + The construct '{0}' may only be used in valid resumable code. '{0}' yapısı yalnızca geçerli sürdürülebilir kodda kullanılabilir. diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index 07d2c64224..f37cbca524 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -647,6 +647,11 @@ 内插字符串中的对齐无效 + + Invalid member declaration. The name of the member is missing or has parentheses. + Invalid member declaration. The name of the member is missing or has parentheses. + + The construct '{0}' may only be used in valid resumable code. 构造 "{0}" 只能在有效的可恢复代码中使用。 diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index 81313be946..c3208a14e0 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -647,6 +647,11 @@ 插補字串中的對齊無效 + + Invalid member declaration. The name of the member is missing or has parentheses. + Invalid member declaration. The name of the member is missing or has parentheses. + + The construct '{0}' may only be used in valid resumable code. 建構 '{0}' 只能用於有效的可繼續程式碼。 diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index b9f831522b..0827291396 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -3042,6 +3042,9 @@ module TypecheckTests = [] let ``type check neg132`` () = singleVersionedNegTest (testConfig "typecheck/sigs") "5.0" "neg132" + + [] + let ``type check neg133`` () = singleNegTest (testConfig "typecheck/sigs") "neg133" [] let ``type check neg_anon_1`` () = singleNegTest (testConfig "typecheck/sigs") "neg_anon_1" diff --git a/tests/fsharp/typecheck/sigs/neg133.bsl b/tests/fsharp/typecheck/sigs/neg133.bsl new file mode 100644 index 0000000000..ed51fcc058 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg133.bsl @@ -0,0 +1,4 @@ + +neg133.fs(4,19,4,22): typecheck error FS3521: Invalid member declaration. The name of the member is missing or has parentheses. + +neg133.fs(7,19,7,27): typecheck error FS3521: Invalid member declaration. The name of the member is missing or has parentheses. diff --git a/tests/fsharp/typecheck/sigs/neg133.fs b/tests/fsharp/typecheck/sigs/neg133.fs new file mode 100644 index 0000000000..5151f48858 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg133.fs @@ -0,0 +1,7 @@ +module Neg133 + +type T = + static member (y) = 0 + +type U = + static member (y: int) = 0