diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md
index 204727757db..06b39cc019d 100644
--- a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md
+++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md
@@ -3,6 +3,7 @@
* Add support for `when 'T : Enum` library-only static optimization constraint. ([PR #18546](https://github.com/dotnet/fsharp/pull/18546))
* Add support for tail calls in computation expressions ([PR #18804](https://github.com/dotnet/fsharp/pull/18804))
* Add `--typecheck-only` flag support for F# Interactive (FSI) scripts to type-check without execution. ([Issue #18686](https://github.com/dotnet/fsharp/issues/18686))
+* Diagnostics: add extended data for 'No constructors' error ([PR #18863](https://github.com/dotnet/fsharp/pull/18863))
### Fixed
diff --git a/src/Compiler/Checking/CheckDeclarations.fs b/src/Compiler/Checking/CheckDeclarations.fs
index 07b40b6b119..e6a39af0a7b 100644
--- a/src/Compiler/Checking/CheckDeclarations.fs
+++ b/src/Compiler/Checking/CheckDeclarations.fs
@@ -1370,7 +1370,8 @@ module MutRecBindingChecking =
try
let baseTy, tpenv = TcType cenv NoNewTypars CheckCxs ItemOccurrence.Use WarnOnIWSAM.Yes envInstance tpenv synBaseTy
let baseTy = baseTy |> convertToTypeWithMetadataIfPossible g
- TcNewExpr cenv envInstance tpenv baseTy (Some synBaseTy.Range) true arg m
+ let mTcNew = unionRanges synBaseTy.Range arg.Range
+ TcNewExpr cenv envInstance tpenv baseTy (Some synBaseTy.Range) true arg mTcNew
with RecoverableException e ->
errorRecovery e m
mkUnit g m, tpenv
diff --git a/src/Compiler/Checking/NameResolution.fs b/src/Compiler/Checking/NameResolution.fs
index e3ad26d3ed7..025ccb3c022 100644
--- a/src/Compiler/Checking/NameResolution.fs
+++ b/src/Compiler/Checking/NameResolution.fs
@@ -38,6 +38,8 @@ open FSharp.Compiler.TypeHierarchy
open FSharp.Compiler.TypeProviders
#endif
+exception NoConstructorsAvailableForType of TType * DisplayEnv * range
+
/// An object that captures the logical context for name resolution.
type NameResolver(g: TcGlobals,
amap: Import.ImportMap,
@@ -2554,7 +2556,7 @@ let private ResolveObjectConstructorPrim (ncenv: NameResolver) edenv resInfo m a
[DefaultStructCtor(g, ty)]
else []
if (isNil defaultStructCtorInfo && isNil ctorInfos) || (not (isAppTy g ty) && not (isAnyTupleTy g ty)) then
- raze (Error(FSComp.SR.nrNoConstructorsAvailableForType(NicePrint.minimalStringOfType edenv ty), m))
+ raze (NoConstructorsAvailableForType(ty, edenv, m))
else
let ctorInfos = ctorInfos |> List.filter (IsMethInfoAccessible amap m ad)
let metadataTy = convertToTypeWithMetadataIfPossible g ty
diff --git a/src/Compiler/Checking/NameResolution.fsi b/src/Compiler/Checking/NameResolution.fsi
index 693c9ec16de..48c164433c2 100755
--- a/src/Compiler/Checking/NameResolution.fsi
+++ b/src/Compiler/Checking/NameResolution.fsi
@@ -14,6 +14,8 @@ open FSharp.Compiler.TypedTree
open FSharp.Compiler.TypedTreeOps
open FSharp.Compiler.TcGlobals
+exception NoConstructorsAvailableForType of TType * DisplayEnv * range
+
/// A NameResolver is a context for name resolution. It primarily holds an InfoReader.
type NameResolver =
diff --git a/src/Compiler/Driver/CompilerDiagnostics.fs b/src/Compiler/Driver/CompilerDiagnostics.fs
index 12e5777201e..d2a64521648 100644
--- a/src/Compiler/Driver/CompilerDiagnostics.fs
+++ b/src/Compiler/Driver/CompilerDiagnostics.fs
@@ -44,34 +44,24 @@ open FSharp.Compiler.TypedTreeOps
let showAssertForUnexpectedException = ref true
#endif
-/// This exception is an old-style way of reporting a diagnostic
exception HashIncludeNotAllowedInNonScript of range
-/// This exception is an old-style way of reporting a diagnostic
exception HashReferenceNotAllowedInNonScript of range
-/// This exception is an old-style way of reporting a diagnostic
exception HashLoadedSourceHasIssues of informationals: exn list * warnings: exn list * errors: exn list * range
-/// This exception is an old-style way of reporting a diagnostic
exception HashLoadedScriptConsideredSource of range
-/// This exception is an old-style way of reporting a diagnostic
exception HashDirectiveNotAllowedInNonScript of range
-/// This exception is an old-style way of reporting a diagnostic
exception DeprecatedCommandLineOptionFull of string * range
-/// This exception is an old-style way of reporting a diagnostic
exception DeprecatedCommandLineOptionForHtmlDoc of string * range
-/// This exception is an old-style way of reporting a diagnostic
exception DeprecatedCommandLineOptionSuggestAlternative of string * string * range
-/// This exception is an old-style way of reporting a diagnostic
exception DeprecatedCommandLineOptionNoDescription of string * range
-/// This exception is an old-style way of reporting a diagnostic
exception InternalCommandLineOption of string * range
type Exception with
@@ -207,7 +197,9 @@ type Exception with
| MSBuildReferenceResolutionError(_, _, m)
| AssemblyNotResolved(_, m)
| HashLoadedSourceHasIssues(_, _, _, m)
- | HashLoadedScriptConsideredSource m -> Some m
+ | HashLoadedScriptConsideredSource m
+ | NoConstructorsAvailableForType(_, _, m) -> Some m
+
// Strip TargetInvocationException wrappers
| :? System.Reflection.TargetInvocationException as e when isNotNull e.InnerException -> (!!e.InnerException).DiagnosticRange
#if !NO_TYPEPROVIDERS
@@ -336,6 +328,7 @@ type Exception with
| PatternMatchCompilation.EnumMatchIncomplete _ -> 104
| Failure _ -> 192
| DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer _ -> 318
+ | NoConstructorsAvailableForType _ -> 1133
| ArgumentsInSigAndImplMismatch _ -> 3218
// Strip TargetInvocationException wrappers
@@ -616,6 +609,8 @@ module OldStyleMessages =
let InvalidAttributeTargetForLanguageElement1E () = Message("InvalidAttributeTargetForLanguageElement1", "%s%s")
let InvalidAttributeTargetForLanguageElement2E () = Message("InvalidAttributeTargetForLanguageElement2", "")
+ let NoConstructorsAvailableForTypeE () = Message("NoConstructorsAvailableForType", "%s")
+
#if DEBUG
let mutable showParserStackOnParseError = false
#endif
@@ -1945,6 +1940,9 @@ type Exception with
let allowedTargets = allowedTargets |> String.concat ", "
os.AppendString(InvalidAttributeTargetForLanguageElement1E().Format elementTargets allowedTargets)
+ | NoConstructorsAvailableForType(t, denv, _) ->
+ os.AppendString(NoConstructorsAvailableForTypeE().Format(NicePrint.minimalStringOfType denv t))
+
// Strip TargetInvocationException wrappers
| :? TargetInvocationException as e when isNotNull e.InnerException -> (!!e.InnerException).Output(os, suggestNames)
diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt
index 4e3c9f81b45..512e9b4dca7 100644
--- a/src/Compiler/FSComp.txt
+++ b/src/Compiler/FSComp.txt
@@ -1019,7 +1019,6 @@ lexfltInvalidNestedConstruct,"'%s' must be defined at module level, not inside a
1129,nrRecordDoesNotContainSuchLabel,"The record type '%s' does not contain a label '%s'."
1130,nrInvalidFieldLabel,"Invalid field label"
1132,nrInvalidExpression,"Invalid expression '%s'"
-1133,nrNoConstructorsAvailableForType,"No constructors are available for the type '%s'"
1134,nrUnionTypeNeedsQualifiedAccess,"The union type for union case '%s' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('%s') in the name you are using."
1135,nrRecordTypeNeedsQualifiedAccess,"The record type for the record field '%s' was defined with the RequireQualifiedAccessAttribute. Include the name of the record type ('%s') in the name you are using."
1136,ilwriteErrorCreatingPdb,"Unexpected error creating debug information file '%s'"
diff --git a/src/Compiler/FSStrings.resx b/src/Compiler/FSStrings.resx
index 7ba844291c9..9e471249843 100644
--- a/src/Compiler/FSStrings.resx
+++ b/src/Compiler/FSStrings.resx
@@ -1152,4 +1152,7 @@
This attribute is not valid for use on this language element
+
+ No constructors are available for the type '{0}'
+
\ No newline at end of file
diff --git a/src/Compiler/Symbols/FSharpDiagnostic.fs b/src/Compiler/Symbols/FSharpDiagnostic.fs
index 2cb7ace6fb8..8854e9eea7e 100644
--- a/src/Compiler/Symbols/FSharpDiagnostic.fs
+++ b/src/Compiler/Symbols/FSharpDiagnostic.fs
@@ -11,6 +11,7 @@ open System
open FSharp.Compiler.CheckExpressions
open FSharp.Compiler.ConstraintSolver
+open FSharp.Compiler.NameResolution
open FSharp.Compiler.SignatureConformance
open FSharp.Compiler.Symbols
open FSharp.Compiler.Syntax
@@ -86,6 +87,12 @@ module ExtendedData =
member x.ContextInfo = context
member x.DisplayContext = FSharpDisplayContext(fun _ -> dispEnv)
+ type TypeExtendedData internal (symbolEnv: SymbolEnv, displayEnv: DisplayEnv, actualType: TType) =
+ interface IFSharpDiagnosticExtendedData
+
+ member x.Type = FSharpType(symbolEnv, actualType)
+ member x.DisplayContext = FSharpDisplayContext(fun _ -> displayEnv)
+
type ExpressionIsAFunctionExtendedData internal (symbolEnv: SymbolEnv, actualType: TType) =
interface IFSharpDiagnosticExtendedData
@@ -203,11 +210,15 @@ type FSharpDiagnostic(m: range, severity: FSharpDiagnosticSeverity, message: str
| DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer(implTycon = implTycon; sigTycon = sigTycon) ->
Some(DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData(sigTycon, implTycon))
- | ObsoleteDiagnostic(diagnosticId= diagnosticId; urlFormat= urlFormat) ->
+ | ObsoleteDiagnostic(diagnosticId = diagnosticId; urlFormat = urlFormat) ->
Some(ObsoleteDiagnosticExtendedData(diagnosticId, urlFormat))
- | Experimental(diagnosticId= diagnosticId; urlFormat= urlFormat) ->
+ | Experimental(diagnosticId = diagnosticId; urlFormat = urlFormat) ->
Some(ExperimentalExtendedData(diagnosticId, urlFormat))
+
+ | NoConstructorsAvailableForType(ttype, displayEnv, _) ->
+ Some(TypeExtendedData(symbolEnv, displayEnv, ttype))
+
| _ -> None
let msg =
diff --git a/src/Compiler/Symbols/FSharpDiagnostic.fsi b/src/Compiler/Symbols/FSharpDiagnostic.fsi
index 6d2768674c6..12500623916 100644
--- a/src/Compiler/Symbols/FSharpDiagnostic.fsi
+++ b/src/Compiler/Symbols/FSharpDiagnostic.fsi
@@ -99,6 +99,13 @@ module ExtendedData =
/// Represents the information needed to format types
member DisplayContext: FSharpDisplayContext
+ []
+ type TypeExtendedData =
+ interface IFSharpDiagnosticExtendedData
+
+ member Type: FSharpType
+ member DisplayContext: FSharpDisplayContext
+
/// Additional data for 'This expression is a function value, i.e. is missing arguments' diagnostic
[]
type ExpressionIsAFunctionExtendedData =
diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf
index 43fadb51613..244be90e142 100644
--- a/src/Compiler/xlf/FSComp.txt.cs.xlf
+++ b/src/Compiler/xlf/FSComp.txt.cs.xlf
@@ -6637,11 +6637,6 @@
Neplatný výraz {0}
-
- No constructors are available for the type '{0}'
- Pro typ {0} nejsou k dispozici žádné konstruktory.
-
- The union type for union case '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('{1}') in the name you are using.Typ sjednocení pro případ sjednocení {0} se definoval pomocí atributu RequireQualifiedAccessAttribute. Do jména, které používáte, přidejte název typu sjednocení ({1}).
diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf
index 19163652970..d1b1782d093 100644
--- a/src/Compiler/xlf/FSComp.txt.de.xlf
+++ b/src/Compiler/xlf/FSComp.txt.de.xlf
@@ -6637,11 +6637,6 @@
Ungültiger Ausdruck "{0}".
-
- No constructors are available for the type '{0}'
- Für den Typ "{0}" sind keine Konstruktoren verfügbar.
-
- The union type for union case '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('{1}') in the name you are using.Der Union-Typ für Union-Fall "{0}" wurde mit RequireQualifiedAccessAttribute definiert. Fügen Sie den Union-Typnamen ("{1}") in den verwendeten Namen ein.
diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf
index b0f3f478be9..cd311cc7fc5 100644
--- a/src/Compiler/xlf/FSComp.txt.es.xlf
+++ b/src/Compiler/xlf/FSComp.txt.es.xlf
@@ -6637,11 +6637,6 @@
Expresión '{0}' no válida.
-
- No constructors are available for the type '{0}'
- No hay constructores disponibles para el tipo '{0}'.
-
- The union type for union case '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('{1}') in the name you are using.El tipo de unión del caso de unión "{0}" se definió con el atributo RequireQualifiedAccessAttribute. Incluya el nombre del tipo de unión ("{1}") en el nombre que esté usando.
diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf
index 1625dc18b6e..e05e9ecdf6c 100644
--- a/src/Compiler/xlf/FSComp.txt.fr.xlf
+++ b/src/Compiler/xlf/FSComp.txt.fr.xlf
@@ -6637,11 +6637,6 @@
Expression non valide '{0}'
-
- No constructors are available for the type '{0}'
- Aucun constructeur n'est disponible pour le type '{0}'
-
- The union type for union case '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('{1}') in the name you are using.Le type union du cas d'union '{0}' a été défini avec RequireQualifiedAccessAttribute. Incluez le nom du type union ('{1}') dans le nom que vous utilisez.
diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf
index 8286e205589..a25fd816046 100644
--- a/src/Compiler/xlf/FSComp.txt.it.xlf
+++ b/src/Compiler/xlf/FSComp.txt.it.xlf
@@ -6637,11 +6637,6 @@
Espressione '{0}' non valida
-
- No constructors are available for the type '{0}'
- Nessun costruttore disponibile per il tipo '{0}'
-
- The union type for union case '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('{1}') in the name you are using.Il tipo di unione per il case di unione '{0}' è stato definito con RequireQualifiedAccessAttribute. Includere il nome del tipo di unione ('{1}') nel nome da usare.
diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf
index 91f36d4b2b0..87b7d40df1e 100644
--- a/src/Compiler/xlf/FSComp.txt.ja.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ja.xlf
@@ -6637,11 +6637,6 @@
式 '{0}' は無効です
-
- No constructors are available for the type '{0}'
- 型 '{0}' に使用できるコンストラクターがありません
-
- The union type for union case '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('{1}') in the name you are using.共用体ケース '{0}' の共用体型が RequireQualifiedAccessAttribute によって定義されました。使用中の名前に共用体型 ('{1}') の名前を含めてください。
diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf
index c40e1df22a4..f2fe6e20f97 100644
--- a/src/Compiler/xlf/FSComp.txt.ko.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ko.xlf
@@ -6637,11 +6637,6 @@
'{0}' 식이 잘못되었습니다.
-
- No constructors are available for the type '{0}'
- '{0}' 형식에 대해 사용할 수 있는 생성자가 없습니다.
-
- The union type for union case '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('{1}') in the name you are using.공용 구조체 케이스 '{0}'에 대한 공용 구조체 형식은 RequireQualifiedAccessAttribute로 정의됩니다. 사용 중인 이름에 공용 구조체 형식('{1}') 이름을 포함하세요.
diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf
index c5d3c30a710..23a194ff258 100644
--- a/src/Compiler/xlf/FSComp.txt.pl.xlf
+++ b/src/Compiler/xlf/FSComp.txt.pl.xlf
@@ -6637,11 +6637,6 @@
Nieprawidłowe wyrażenie „{0}”
-
- No constructors are available for the type '{0}'
- Brak konstruktorów dostępnych dla typu „{0}”
-
- The union type for union case '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('{1}') in the name you are using.Typ unii dla przypadku unii „{0}” został zdefiniowany z użyciem wartości RequireQualifiedAccessAttribute. Uwzględnij nazwę typu unii („{1}”) w używanej nazwie.
diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
index 715f6bc778f..503fc0f073f 100644
--- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
+++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf
@@ -6637,11 +6637,6 @@
Expressão '{0}' inválida
-
- No constructors are available for the type '{0}'
- Nenhum construtor está disponível para o tipo '{0}'
-
- The union type for union case '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('{1}') in the name you are using.O tipo de união para o caso de união '{0}' foi definido com o RequireQualifiedAccessAttribute. Inclua o nome do tipo de união ('{1}') no nome que você está usando.
diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf
index 01fa5d498bb..7013fb0bc83 100644
--- a/src/Compiler/xlf/FSComp.txt.ru.xlf
+++ b/src/Compiler/xlf/FSComp.txt.ru.xlf
@@ -6637,11 +6637,6 @@
Недопустимое выражение "{0}"
-
- No constructors are available for the type '{0}'
- Недоступны конструкторы для типа "{0}"
-
- The union type for union case '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('{1}') in the name you are using.Тип объединения для ветви объединения "{0}" определен с RequireQualifiedAccessAttribute. Включите имя типа объединения ("{1}") в используемое имя.
diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf
index fbce9ee4662..49d2a295b45 100644
--- a/src/Compiler/xlf/FSComp.txt.tr.xlf
+++ b/src/Compiler/xlf/FSComp.txt.tr.xlf
@@ -6637,11 +6637,6 @@
Geçersiz ifade: '{0}'
-
- No constructors are available for the type '{0}'
- '{0}' türü için kullanılabilir bir oluşturucu yok
-
- The union type for union case '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('{1}') in the name you are using.{0}' birleşim durumunun birleşim türü RequireQualifiedAccessAttribute ile tanımlanmış. Kullandığınız ada birleşim türünün adını ('{1}') dahil edin.
diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
index 224b515560d..3fc65eebc96 100644
--- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
+++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf
@@ -6637,11 +6637,6 @@
表达式“{0}”无效
-
- No constructors are available for the type '{0}'
- 没有对类型“{0}”可用的构造函数
-
- The union type for union case '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('{1}') in the name you are using.使用 RequireQualifiedAccessAttribute 定义联合用例“{0}”的联合类型。包括所使用的名称中联合类型 ('{1}') 的名称。
diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
index f5129e2f03a..07fea0efd23 100644
--- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
+++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf
@@ -6637,11 +6637,6 @@
無效的運算式 '{0}'
-
- No constructors are available for the type '{0}'
- 沒有可供類型 '{0}' 使用的建構函式
-
- The union type for union case '{0}' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('{1}') in the name you are using.聯集 '{0}' 的等位型別由 RequireQualifiedAccessAttribute 定義。請在您使用的名稱中,加入等位型別 '{1}' 的名稱。
diff --git a/src/Compiler/xlf/FSStrings.cs.xlf b/src/Compiler/xlf/FSStrings.cs.xlf
index 62c8a4c9b5b..80fc8d575a2 100644
--- a/src/Compiler/xlf/FSStrings.cs.xlf
+++ b/src/Compiler/xlf/FSStrings.cs.xlf
@@ -67,6 +67,11 @@
This attribute is not valid for use on this language element
+
+ No constructors are available for the type '{0}'
+ No constructors are available for the type '{0}'
+
+ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attributePřípady sjednocení s malými písmeny jsou povolené jenom při použití atributu RequireQualifiedAccess.
diff --git a/src/Compiler/xlf/FSStrings.de.xlf b/src/Compiler/xlf/FSStrings.de.xlf
index bd7231f7eb0..cad73cb05c3 100644
--- a/src/Compiler/xlf/FSStrings.de.xlf
+++ b/src/Compiler/xlf/FSStrings.de.xlf
@@ -67,6 +67,11 @@
This attribute is not valid for use on this language element
+
+ No constructors are available for the type '{0}'
+ No constructors are available for the type '{0}'
+
+ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attributeDiskriminierte Union-Fälle in Kleinbuchstaben sind nur zulässig, wenn das RequireQualifiedAccess-Attribut verwendet wird.
diff --git a/src/Compiler/xlf/FSStrings.es.xlf b/src/Compiler/xlf/FSStrings.es.xlf
index b742c23b61a..e262a1eae44 100644
--- a/src/Compiler/xlf/FSStrings.es.xlf
+++ b/src/Compiler/xlf/FSStrings.es.xlf
@@ -67,6 +67,11 @@
This attribute is not valid for use on this language element
+
+ No constructors are available for the type '{0}'
+ No constructors are available for the type '{0}'
+
+ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attributeLos casos de unión discriminada en minúsculas solo se permiten cuando se usa el atributo RequireQualifiedAccess
diff --git a/src/Compiler/xlf/FSStrings.fr.xlf b/src/Compiler/xlf/FSStrings.fr.xlf
index 5ea093f08b6..0a265c96bea 100644
--- a/src/Compiler/xlf/FSStrings.fr.xlf
+++ b/src/Compiler/xlf/FSStrings.fr.xlf
@@ -67,6 +67,11 @@
This attribute is not valid for use on this language element
+
+ No constructors are available for the type '{0}'
+ No constructors are available for the type '{0}'
+
+ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attributeLes cas d’union discriminée en minuscules sont uniquement autorisés lors de l’utilisation de l’attribut RequireQualifiedAccess.
diff --git a/src/Compiler/xlf/FSStrings.it.xlf b/src/Compiler/xlf/FSStrings.it.xlf
index cc5b2dee04d..b0ceff4e83a 100644
--- a/src/Compiler/xlf/FSStrings.it.xlf
+++ b/src/Compiler/xlf/FSStrings.it.xlf
@@ -67,6 +67,11 @@
This attribute is not valid for use on this language element
+
+ No constructors are available for the type '{0}'
+ No constructors are available for the type '{0}'
+
+ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attributeI casi di unione discriminati minuscoli sono consentiti solo quando si usa l'attributo RequireQualifiedAccess
diff --git a/src/Compiler/xlf/FSStrings.ja.xlf b/src/Compiler/xlf/FSStrings.ja.xlf
index 8ff3956536f..58439655441 100644
--- a/src/Compiler/xlf/FSStrings.ja.xlf
+++ b/src/Compiler/xlf/FSStrings.ja.xlf
@@ -67,6 +67,11 @@
This attribute is not valid for use on this language element
+
+ No constructors are available for the type '{0}'
+ No constructors are available for the type '{0}'
+
+ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute小文字で区別される和集合のケースは、RequireQualifiedAccess 属性を使用する場合にのみ許可されます
diff --git a/src/Compiler/xlf/FSStrings.ko.xlf b/src/Compiler/xlf/FSStrings.ko.xlf
index e7811efd1fb..84886e9c6ca 100644
--- a/src/Compiler/xlf/FSStrings.ko.xlf
+++ b/src/Compiler/xlf/FSStrings.ko.xlf
@@ -67,6 +67,11 @@
This attribute is not valid for use on this language element
+
+ No constructors are available for the type '{0}'
+ No constructors are available for the type '{0}'
+
+ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute소문자로 구분된 공용 구조체 케이스는 RequireQualifiedAccess 특성을 사용하는 경우에만 허용됩니다.
diff --git a/src/Compiler/xlf/FSStrings.pl.xlf b/src/Compiler/xlf/FSStrings.pl.xlf
index 7d10392f2d0..04e2db874cd 100644
--- a/src/Compiler/xlf/FSStrings.pl.xlf
+++ b/src/Compiler/xlf/FSStrings.pl.xlf
@@ -67,6 +67,11 @@
This attribute is not valid for use on this language element
+
+ No constructors are available for the type '{0}'
+ No constructors are available for the type '{0}'
+
+ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attributePrzypadki unii z dyskryminatorem z małymi literami są dozwolone tylko w przypadku używania atrybutu RequireQualifiedAccess
diff --git a/src/Compiler/xlf/FSStrings.pt-BR.xlf b/src/Compiler/xlf/FSStrings.pt-BR.xlf
index b8f1477ffd8..ecce364bb99 100644
--- a/src/Compiler/xlf/FSStrings.pt-BR.xlf
+++ b/src/Compiler/xlf/FSStrings.pt-BR.xlf
@@ -67,6 +67,11 @@
This attribute is not valid for use on this language element
+
+ No constructors are available for the type '{0}'
+ No constructors are available for the type '{0}'
+
+ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attributeOs casos de união discriminados em letras minúsculas só são permitidos ao usar o atributo RequireQualifiedAccess
diff --git a/src/Compiler/xlf/FSStrings.ru.xlf b/src/Compiler/xlf/FSStrings.ru.xlf
index cf4ea76ede9..fff4ab3f12d 100644
--- a/src/Compiler/xlf/FSStrings.ru.xlf
+++ b/src/Compiler/xlf/FSStrings.ru.xlf
@@ -67,6 +67,11 @@
This attribute is not valid for use on this language element
+
+ No constructors are available for the type '{0}'
+ No constructors are available for the type '{0}'
+
+ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attributeРазмеченные в нижнем регистре случаи объединения разрешены только при использовании атрибута RequireQualifiedAccess
diff --git a/src/Compiler/xlf/FSStrings.tr.xlf b/src/Compiler/xlf/FSStrings.tr.xlf
index a4812ae8b03..69a73dfd9fd 100644
--- a/src/Compiler/xlf/FSStrings.tr.xlf
+++ b/src/Compiler/xlf/FSStrings.tr.xlf
@@ -67,6 +67,11 @@
This attribute is not valid for use on this language element
+
+ No constructors are available for the type '{0}'
+ No constructors are available for the type '{0}'
+
+ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attributeKüçük harf ayrımlı birleşim durumlarına yalnızca RequireQualifiedAccess özniteliği kullanılırken izin verilir
diff --git a/src/Compiler/xlf/FSStrings.zh-Hans.xlf b/src/Compiler/xlf/FSStrings.zh-Hans.xlf
index 6f9680c914f..f2f98d4e788 100644
--- a/src/Compiler/xlf/FSStrings.zh-Hans.xlf
+++ b/src/Compiler/xlf/FSStrings.zh-Hans.xlf
@@ -67,6 +67,11 @@
This attribute is not valid for use on this language element
+
+ No constructors are available for the type '{0}'
+ No constructors are available for the type '{0}'
+
+ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute仅当使用 RequireQualifiedAccess 属性时才允许区分小写的联合事例
diff --git a/src/Compiler/xlf/FSStrings.zh-Hant.xlf b/src/Compiler/xlf/FSStrings.zh-Hant.xlf
index 581e38ca65e..571fa7b1446 100644
--- a/src/Compiler/xlf/FSStrings.zh-Hant.xlf
+++ b/src/Compiler/xlf/FSStrings.zh-Hant.xlf
@@ -67,6 +67,11 @@
This attribute is not valid for use on this language element
+
+ No constructors are available for the type '{0}'
+ No constructors are available for the type '{0}'
+
+ Lowercase discriminated union cases are only allowed when using RequireQualifiedAccess attribute只有在使用 RequireQualifiedAccess 屬性時,才允許小寫區分聯結案例
diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/ExceptionDefinitions.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/ExceptionDefinitions.fs
index 01f7d1f1e5b..a847061f05c 100644
--- a/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/ExceptionDefinitions.fs
+++ b/tests/FSharp.Compiler.ComponentTests/Conformance/BasicGrammarElements/ExceptionDefinitions/ExceptionDefinitions.fs
@@ -291,7 +291,7 @@ module ExceptionDefinition =
|> shouldFail
|> withDiagnostics [
(Error 945, Line 9, Col 13, Line 9, Col 22, "Cannot inherit a sealed type")
- (Error 1133, Line 9, Col 5, Line 9, Col 24, "No constructors are available for the type 'FSharpExn'")
+ (Error 1133, Line 9, Col 13, Line 9, Col 24, "No constructors are available for the type 'FSharpExn'")
]
// SOURCE=E_MatchFailure.fsx SCFLAGS=--test:ErrorRanges # E_MatchFailure.fsx
diff --git a/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ApplicationExpressions/Ctor.fs b/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ApplicationExpressions/Ctor.fs
new file mode 100644
index 00000000000..1206d0f7513
--- /dev/null
+++ b/tests/FSharp.Compiler.ComponentTests/Conformance/Expressions/ApplicationExpressions/Ctor.fs
@@ -0,0 +1,14 @@
+module FSharp.Compiler.ComponentTests.Conformance.Expressions.ApplicationExpressions.Ctor
+
+open FSharp.Test.Compiler
+open Xunit
+
+[]
+let ``Nullable 01`` () =
+ FSharp """
+module Module
+
+let _ = System.Nullable()
+"""
+ |> typecheck
+ |> shouldSucceed
diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ExtendedDiagnosticDataTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ExtendedDiagnosticDataTests.fs
index e2615a4da62..f3448e09440 100755
--- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ExtendedDiagnosticDataTests.fs
+++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/ExtendedDiagnosticDataTests.fs
@@ -7,7 +7,7 @@ open FSharp.Compiler.Diagnostics.ExtendedData
open FSharp.Test.Compiler
open Xunit
-let inline checkDiagnostic
+let inline checkDiagnosticData
(diagnosticNumber, message)
(check: 'a -> unit)
(checkResults: 'b when 'b: (member Diagnostics: FSharpDiagnostic[])) =
@@ -27,7 +27,7 @@ let ``TypeMismatchDiagnosticExtendedData 01`` () =
let x, y, z = 1, 2
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(1, "Type mismatch. Expecting a tuple of length 3 of type\n 'a * 'b * 'c \nbut given a tuple of length 2 of type\n int * int \n")
(fun (typeMismatch: TypeMismatchDiagnosticExtendedData) ->
Assert.Equal(DiagnosticContextInfo.NoContext, typeMismatch.ContextInfo)
@@ -41,7 +41,7 @@ let ``TypeMismatchDiagnosticExtendedData 02`` () =
let x, y = 1
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(1, "This expression was expected to have type\n ''a * 'b' \nbut here has type\n 'int' ")
(fun (typeMismatch: TypeMismatchDiagnosticExtendedData) ->
let displayContext = typeMismatch.DisplayContext
@@ -55,7 +55,7 @@ let ``TypeMismatchDiagnosticExtendedData 03`` () =
if true then 5
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(1, "This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type 'int'.")
(fun (typeMismatch: TypeMismatchDiagnosticExtendedData) ->
let displayContext = typeMismatch.DisplayContext
@@ -69,7 +69,7 @@ let ``TypeMismatchDiagnosticExtendedData 04`` () =
1 :> string
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(193, "Type constraint mismatch. The type \n 'int' \nis not compatible with type\n 'string' \n")
(fun (typeMismatch: TypeMismatchDiagnosticExtendedData) ->
let displayContext = typeMismatch.DisplayContext
@@ -85,7 +85,7 @@ match 0 with
| 1 -> "a"
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(1, "All branches of a pattern match expression must return values implicitly convertible to the type of the first branch, which here is 'int'. This branch returns a value of type 'string'.")
(fun (typeMismatch: TypeMismatchDiagnosticExtendedData) ->
let displayContext = typeMismatch.DisplayContext
@@ -106,7 +106,7 @@ match 0 with
1
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(1, "This expression was expected to have type\n 'int' \nbut here has type\n 'string' ")
(fun (typeMismatch: TypeMismatchDiagnosticExtendedData) ->
let displayContext = typeMismatch.DisplayContext
@@ -121,7 +121,7 @@ let _: bool =
if true then "a" else "b"
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(1, "The 'if' expression needs to have type 'bool' to satisfy context type requirements. It currently has type 'string'.")
(fun (typeMismatch: TypeMismatchDiagnosticExtendedData) ->
let displayContext = typeMismatch.DisplayContext
@@ -135,7 +135,7 @@ let ``TypeMismatchDiagnosticExtendedData 07`` () =
if true then 1 else "a"
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(1, "All branches of an 'if' expression must return values implicitly convertible to the type of the first branch, which here is 'int'. This branch returns a value of type 'string'.")
(fun (typeMismatch: TypeMismatchDiagnosticExtendedData) ->
let displayContext = typeMismatch.DisplayContext
@@ -150,7 +150,7 @@ type R = { Field1: int }
let f (x: R) = "" + x.Field1
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(1, "The type 'int' does not match the type 'string'")
(fun (typeMismatch: TypeMismatchDiagnosticExtendedData) ->
let displayContext = typeMismatch.DisplayContext
@@ -164,7 +164,7 @@ let ``TypeMismatchDiagnosticExtendedData 09`` () =
let x: string = 1
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(1, "This expression was expected to have type\n 'string' \nbut here has type\n 'int' ")
(fun (typeMismatch: TypeMismatchDiagnosticExtendedData) ->
let displayContext = typeMismatch.DisplayContext
@@ -179,7 +179,7 @@ let f1 (x: outref<'T>) = 1
let f2 (x: inref<'T>) = f1 &x
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(1, "Type mismatch. Expecting a\n 'outref<'T>' \nbut given a\n 'inref<'T>' \nThe type 'ByRefKinds.Out' does not match the type 'ByRefKinds.In'")
(fun (typeMismatch: TypeMismatchDiagnosticExtendedData) ->
let displayContext = typeMismatch.DisplayContext
@@ -204,7 +204,7 @@ let f (y: int) = ()
encodeFsi
|> withAdditionalSourceFile encodeFs
|> typecheckProject true useTransparentCompiler
- |> checkDiagnostic
+ |> checkDiagnosticData
(3218, "The argument names in the signature 'x' and implementation 'y' do not match. The argument name from the signature file will be used. This may cause problems when debugging or profiling.")
(fun (argsMismatch: ArgumentsInSigAndImplMismatchExtendedData) ->
Assert.Equal("x", argsMismatch.SignatureName)
@@ -231,7 +231,7 @@ type A =
encodeFsi
|> withAdditionalSourceFile encodeFs
|> typecheckProject true useTransparentCompiler
- |> checkDiagnostic
+ |> checkDiagnosticData
(193, "The module contains the field\n myStatic: int \nbut its signature specifies\n myStatic: int \nthe accessibility specified in the signature is more than that specified in the implementation")
(fun (fieldsData: FieldNotContainedDiagnosticExtendedData) ->
Assert.True(fieldsData.SignatureField.Accessibility.IsPublic)
@@ -245,7 +245,7 @@ module Test
id
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(193, "This expression is a function value, i.e. is missing arguments. Its type is 'a -> 'a.")
(fun (wrongType: ExpressionIsAFunctionExtendedData) ->
Assert.Equal("type 'a -> 'a", wrongType.ActualType.ToString()))
@@ -279,7 +279,7 @@ type Foo = {| bar: int; x: int |}
signature
|> withAdditionalSourceFile implementation
|> typecheckProject true useTransparentCompiler
- |> checkDiagnostic
+ |> checkDiagnosticData
(318, "The type definitions for type 'Foo' in the signature and implementation are not compatible because the abbreviations differ:\n {| bar: int; x: int |}\nversus\n {| bar: int |}")
(fun (fieldsData: DefinitionsInSigAndImplNotCompatibleAbbreviationsDifferExtendedData) ->
assertRange (4,5) (4,8) fieldsData.SignatureRange
@@ -296,7 +296,7 @@ type MyClass() = class end
let x = MyClass()
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(44, "This construct is deprecated. Message")
(fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) ->
Assert.Equal(Some "FS222", obsoleteDiagnostic.DiagnosticId)
@@ -312,7 +312,7 @@ type MyClass() = class end
let x = MyClass()
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(44, "This construct is deprecated. Message")
(fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) ->
Assert.Equal(Some "FS222", obsoleteDiagnostic.DiagnosticId)
@@ -328,7 +328,7 @@ type MyClass() = class end
let x = MyClass()
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(44, "This construct is deprecated. Message")
(fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) ->
Assert.Equal(None, obsoleteDiagnostic.DiagnosticId)
@@ -344,7 +344,7 @@ type MyClass() = class end
let x = MyClass()
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(44, "This construct is deprecated")
(fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) ->
Assert.Equal(Some "FS222", obsoleteDiagnostic.DiagnosticId)
@@ -376,7 +376,7 @@ let text = Class1.Test();
app
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(44, "This construct is deprecated. Use something else")
(fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) ->
Assert.Equal(Some "FS222", obsoleteDiagnostic.DiagnosticId)
@@ -407,7 +407,7 @@ let text = Class1.Test();
app
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(44, "This construct is deprecated. Use something else")
(fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) ->
Assert.Equal(Some "FS222", obsoleteDiagnostic.DiagnosticId)
@@ -438,7 +438,7 @@ let text = Class1.Test();
app
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(44, "This construct is deprecated. Use something else")
(fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) ->
Assert.Equal(None, obsoleteDiagnostic.DiagnosticId)
@@ -469,7 +469,7 @@ let text = Class1.Test();
app
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(44, "This construct is deprecated")
(fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) ->
Assert.Equal(Some "FS222", obsoleteDiagnostic.DiagnosticId)
@@ -485,7 +485,7 @@ type MyClass() = class end
let x = MyClass()
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(44, "This construct is deprecated")
(fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) ->
Assert.Equal(None, obsoleteDiagnostic.DiagnosticId)
@@ -516,7 +516,7 @@ let text = Class1.Test();
app
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(44, "This construct is deprecated")
(fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) ->
Assert.Equal(None, obsoleteDiagnostic.DiagnosticId)
@@ -532,7 +532,7 @@ type MyClass() = class end
let x = MyClass()
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(101, "This construct is deprecated. Message")
(fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) ->
Assert.Equal(Some "FS222", obsoleteDiagnostic.DiagnosticId)
@@ -548,7 +548,7 @@ type MyClass() = class end
let x = MyClass()
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(101, "This construct is deprecated. Message")
(fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) ->
Assert.Equal(Some "FS222", obsoleteDiagnostic.DiagnosticId)
@@ -564,7 +564,7 @@ type MyClass() = class end
let x = MyClass()
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(101, "This construct is deprecated. Message")
(fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) ->
Assert.Equal(None, obsoleteDiagnostic.DiagnosticId)
@@ -580,7 +580,7 @@ type MyClass() = class end
let x = MyClass()
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(101, "This construct is deprecated")
(fun (obsoleteDiagnostic: ObsoleteDiagnosticExtendedData) ->
Assert.Equal(Some "FS222", obsoleteDiagnostic.DiagnosticId)
@@ -612,7 +612,7 @@ let text = Class1.Test();
app
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(57, """This construct is experimental. This warning can be disabled using '--nowarn:57' or '#nowarn "57"'.""")
(fun (experimental: ExperimentalExtendedData) ->
Assert.Equal(Some "FS222", experimental.DiagnosticId)
@@ -645,7 +645,7 @@ let text = Class1.Test();
app
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(57, """This construct is experimental. This warning can be disabled using '--nowarn:57' or '#nowarn "57"'.""")
(fun (experimental: ExperimentalExtendedData) ->
Assert.Equal(Some "FS222", experimental.DiagnosticId)
@@ -663,7 +663,7 @@ type Class1() =
let text = Class1.Test();
"""
|> typecheckResults
- |> checkDiagnostic
+ |> checkDiagnosticData
(57, """This construct is experimental. Use with caution. This warning can be disabled using '--nowarn:57' or '#nowarn "57"'.""")
(fun (experimental: ExperimentalExtendedData) ->
Assert.Equal(None, experimental.DiagnosticId)
diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj
index ba1eedab848..960057baf98 100644
--- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj
+++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj
@@ -83,6 +83,7 @@
+
diff --git a/tests/FSharp.Compiler.ComponentTests/TypeChecks/CheckTypeTests.fs b/tests/FSharp.Compiler.ComponentTests/TypeChecks/CheckTypeTests.fs
index fa72d17828e..8b057109d7b 100644
--- a/tests/FSharp.Compiler.ComponentTests/TypeChecks/CheckTypeTests.fs
+++ b/tests/FSharp.Compiler.ComponentTests/TypeChecks/CheckTypeTests.fs
@@ -1,5 +1,8 @@
module TypeChecks.CheckTypeTests
+open ErrorMessages.ExtendedDiagnosticData
+open FSharp.Compiler.Diagnostics.ExtendedData
+open FSharp.Test.Assert
open Xunit
open FSharp.Test.Compiler
@@ -13,3 +16,28 @@ type Other = int
"""
|> typecheck
|> withSingleDiagnostic (Error 3580, Line 4, Col 21, Line 4, Col 31, "Unexpected function type in union case field definition. If you intend the field to be a function, consider wrapping the function signature with parens, e.g. | Case of a -> b into | Case of (a -> b).")
+
+
+[]
+let ``Class - Inherit 01`` () =
+ FSharp """
+type A = class end
+
+type B() =
+ inherit A()
+"""
+ |> typecheck
+ |> withSingleDiagnostic (Error 1133, Line 5, Col 13, Line 5, Col 16, "No constructors are available for the type 'A'")
+
+[]
+let ``Class - Inherit 02 - Data`` () =
+ FSharp """
+type A = class end
+
+type B() =
+ inherit A()
+"""
+ |> typecheckResults
+ |> checkDiagnosticData
+ (1133, "No constructors are available for the type 'A'")
+ (fun (typeData: TypeExtendedData) -> typeData.Type.Format(typeData.DisplayContext) |> shouldEqual "A")
diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl
index bc08c7fd0bd..31ecae647c8 100644
--- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl
+++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.debug.bsl
@@ -2849,6 +2849,10 @@ FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microso
FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] UrlFormat
FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_DiagnosticId()
FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_UrlFormat()
+FSharp.Compiler.Diagnostics.ExtendedData+TypeExtendedData: FSharp.Compiler.Symbols.FSharpDisplayContext DisplayContext
+FSharp.Compiler.Diagnostics.ExtendedData+TypeExtendedData: FSharp.Compiler.Symbols.FSharpDisplayContext get_DisplayContext()
+FSharp.Compiler.Diagnostics.ExtendedData+TypeExtendedData: FSharp.Compiler.Symbols.FSharpType Type
+FSharp.Compiler.Diagnostics.ExtendedData+TypeExtendedData: FSharp.Compiler.Symbols.FSharpType get_Type()
FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: DiagnosticContextInfo ContextInfo
FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: DiagnosticContextInfo get_ContextInfo()
FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpDisplayContext DisplayContext
@@ -2869,6 +2873,7 @@ FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedDa
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+IFSharpDiagnosticExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData
+FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+TypeExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData
FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnostic Create(FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity, System.String, Int32, FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.String])
diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl
index bc08c7fd0bd..31ecae647c8 100644
--- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl
+++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl
@@ -2849,6 +2849,10 @@ FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microso
FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] UrlFormat
FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_DiagnosticId()
FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData: Microsoft.FSharp.Core.FSharpOption`1[System.String] get_UrlFormat()
+FSharp.Compiler.Diagnostics.ExtendedData+TypeExtendedData: FSharp.Compiler.Symbols.FSharpDisplayContext DisplayContext
+FSharp.Compiler.Diagnostics.ExtendedData+TypeExtendedData: FSharp.Compiler.Symbols.FSharpDisplayContext get_DisplayContext()
+FSharp.Compiler.Diagnostics.ExtendedData+TypeExtendedData: FSharp.Compiler.Symbols.FSharpType Type
+FSharp.Compiler.Diagnostics.ExtendedData+TypeExtendedData: FSharp.Compiler.Symbols.FSharpType get_Type()
FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: DiagnosticContextInfo ContextInfo
FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: DiagnosticContextInfo get_ContextInfo()
FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData: FSharp.Compiler.Symbols.FSharpDisplayContext DisplayContext
@@ -2869,6 +2873,7 @@ FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedDa
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+FieldNotContainedDiagnosticExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+IFSharpDiagnosticExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ObsoleteDiagnosticExtendedData
+FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+TypeExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+TypeMismatchDiagnosticExtendedData
FSharp.Compiler.Diagnostics.ExtendedData: FSharp.Compiler.Diagnostics.ExtendedData+ValueNotContainedDiagnosticExtendedData
FSharp.Compiler.Diagnostics.FSharpDiagnostic: FSharp.Compiler.Diagnostics.FSharpDiagnostic Create(FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity, System.String, Int32, FSharp.Compiler.Text.Range, Microsoft.FSharp.Core.FSharpOption`1[System.String], Microsoft.FSharp.Core.FSharpOption`1[System.String])
diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/InheritsDeclarations/E_InheritFromGenericType01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/InheritsDeclarations/E_InheritFromGenericType01.fs
index 296ceb98777..8d11b128e98 100644
--- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/InheritsDeclarations/E_InheritFromGenericType01.fs
+++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/InheritsDeclarations/E_InheritFromGenericType01.fs
@@ -2,7 +2,7 @@
// Regression test for FSHARP1.0:3782
// Make sure we do not ICE when trying to
// inherit from a type variable.
-//Cannot inherit from a variable type
+//Cannot inherit from a variable type
#light
type X<'a>() = class