diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs
index f6fc5a409ea..c6341838189 100644
--- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs
+++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs
@@ -3916,6 +3916,15 @@ type internal SR private() =
/// Union case/exception '%s' does not have field named '%s'.
/// (Originally from ..\FSComp.txt:1296)
static member tcUnionCaseConstructorDoesNotHaveFieldWithGivenName(a0 : System.String, a1 : System.String) = (3174, GetStringFunc("tcUnionCaseConstructorDoesNotHaveFieldWithGivenName",",,,%s,,,%s,,,") a0 a1)
+ /// The exception '%s' does not have a field named '%s'.
+ /// (Originally from ..\FSComp.txt:1297)
+ static member tcExceptionConstructorDoesNotHaveFieldWithGivenName(a0 : System.String, a1 : System.String) = (3174, GetStringFunc("tcExceptionConstructorDoesNotHaveFieldWithGivenName",",,,%s,,,%s,,,") a0 a1)
+ /// Active patterns do not have fields. This syntax is invalid.
+ /// (Originally from ..\FSComp.txt:1298)
+ static member tcActivePatternsDoNotHaveFields() = (3174, GetStringFunc("tcActivePatternsDoNotHaveFields",",,,") )
+ /// The constructor does not have a field named '%s'.
+ /// (Originally from ..\FSComp.txt:1299)
+ static member tcConstructorDoesNotHaveFieldWithGivenName(a0 : System.String) = (3174, GetStringFunc("tcConstructorDoesNotHaveFieldWithGivenName",",,,%s,,,") a0)
/// Union case/exception field '%s' cannot be used more than once.
/// (Originally from ..\FSComp.txt:1297)
static member tcUnionCaseFieldCannotBeUsedMoreThanOnce(a0 : System.String) = (3175, GetStringFunc("tcUnionCaseFieldCannotBeUsedMoreThanOnce",",,,%s,,,") a0)
diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx
index a56052a1e9d..c34fee949bd 100644
--- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx
+++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx
@@ -3916,7 +3916,16 @@
Array method '{0}' is supplied by the runtime and cannot be directly used in code. For operations with array elements consider using family of GetArray/SetArray functions from LanguagePrimitives.IntrinsicFunctions module.
- Union case/exception '{0}' does not have field named '{1}'.
+ The union case '{0}' does not have a field named '{1}'.
+
+
+ The exception '{0}' does not have a field named '{1}'.
+
+
+ Active patterns do not have fields. This syntax is invalid.
+
+
+ The constructor does not have a field named '{0}'.Union case/exception field '{0}' cannot be used more than once.
diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt
index b8b72353118..a3f5f82d0ea 100644
--- a/src/fsharp/FSComp.txt
+++ b/src/fsharp/FSComp.txt
@@ -1293,7 +1293,10 @@ descriptionUnavailable,"(description unavailable...)"
3171,tcGeneratedTypesShouldBeInternalOrPrivate,"The provided types generated by this use of a type provider may not be used from other F# assemblies and should be marked internal or private. Consider using 'type internal TypeName = ...' or 'type private TypeName = ...'."
3172,chkGetterAndSetterHaveSamePropertyType,"A property's getter and setter must have the same type. Property '%s' has getter of type '%s' but setter of type '%s'."
3173,tcRuntimeSuppliedMethodCannotBeUsedInUserCode,"Array method '%s' is supplied by the runtime and cannot be directly used in code. For operations with array elements consider using family of GetArray/SetArray functions from LanguagePrimitives.IntrinsicFunctions module."
-3174,tcUnionCaseConstructorDoesNotHaveFieldWithGivenName,"Union case/exception '%s' does not have field named '%s'."
+3174,tcUnionCaseConstructorDoesNotHaveFieldWithGivenName,"The union case '%s' does not have a field named '%s'."
+3174,tcExceptionConstructorDoesNotHaveFieldWithGivenName,"The exception '%s' does not have a field named '%s'."
+3174,tcActivePatternsDoNotHaveFields,"Active patterns do not have fields. This syntax is invalid."
+3174,tcConstructorDoesNotHaveFieldWithGivenName,"The constructor does not have a field named '%s'."
3175,tcUnionCaseFieldCannotBeUsedMoreThanOnce,"Union case/exception field '%s' cannot be used more than once."
3176,tcFieldNameIsUsedModeThanOnce,"Named field '%s' is used more than once."
3176,tcFieldNameConflictsWithGeneratedNameForAnonymousField,"Named field '%s' conflicts with autogenerated name for anonymous field."
diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs
index 7f5d834a519..c558602ffa9 100755
--- a/src/fsharp/TypeChecker.fs
+++ b/src/fsharp/TypeChecker.fs
@@ -5316,12 +5316,14 @@ and TcPat warnOnUpper cenv env topValInfo vFlags (tpenv, names, takenNames) ty p
for (id, pat) in pairs do
match argNames |> List.tryFindIndex (fun id2 -> id.idText = id2.idText) with
| None ->
- let caseName =
- match item with
- | Item.UnionCase(uci, _) -> uci.Name
- | Item.ExnCase tcref -> tcref.DisplayName
- | _ -> failwith "impossible"
- error(Error(FSComp.SR.tcUnionCaseConstructorDoesNotHaveFieldWithGivenName(caseName, id.idText), id.idRange))
+ match item with
+ | Item.UnionCase(uci, _) ->
+ error(Error(FSComp.SR.tcUnionCaseConstructorDoesNotHaveFieldWithGivenName(uci.Name, id.idText), id.idRange))
+ | Item.ExnCase tcref ->
+ error(Error(FSComp.SR.tcExceptionConstructorDoesNotHaveFieldWithGivenName(tcref.DisplayName, id.idText), id.idRange))
+ | _ ->
+ error(Error(FSComp.SR.tcConstructorDoesNotHaveFieldWithGivenName(id.idText), id.idRange))
+
| Some idx ->
match box result.[idx] with
| null ->
@@ -8644,13 +8646,16 @@ and TcItemThen cenv overallTy env tpenv (item, mItem, rest, afterResolution) del
assert (isNull(box fittedArgs.[currentIndex]))
fittedArgs.[currentIndex] <- List.item currentIndex args // grab original argument, not item from the list of named parameters
currentIndex <- currentIndex + 1
- else
- let caseName =
- match item with
- | Item.UnionCase(uci, _) -> uci.Name
- | Item.ExnCase tcref -> tcref.DisplayName
- | _ -> failwith "impossible"
- error(Error(FSComp.SR.tcUnionCaseConstructorDoesNotHaveFieldWithGivenName(caseName, id.idText), id.idRange))
+ else
+ match item with
+ | Item.UnionCase(uci, _) ->
+ error(Error(FSComp.SR.tcUnionCaseConstructorDoesNotHaveFieldWithGivenName(uci.Name, id.idText), id.idRange))
+ | Item.ExnCase tcref ->
+ error(Error(FSComp.SR.tcExceptionConstructorDoesNotHaveFieldWithGivenName(tcref.DisplayName, id.idText), id.idRange))
+ | Item.ActivePatternResult(_,_,_,_) ->
+ error(Error(FSComp.SR.tcActivePatternsDoNotHaveFields(), id.idRange))
+ | _ ->
+ error(Error(FSComp.SR.tcConstructorDoesNotHaveFieldWithGivenName(id.idText), id.idRange))
assert (Seq.forall (box >> ((<>) null) ) fittedArgs)
List.ofArray fittedArgs
diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf
index 05d6ee76c54..1c840d2c66e 100644
--- a/src/fsharp/xlf/FSComp.txt.cs.xlf
+++ b/src/fsharp/xlf/FSComp.txt.cs.xlf
@@ -6328,8 +6328,8 @@
-
- Výjimka nebo případ typu union {0} nemá pole s názvem {1}.
+
+ Výjimka nebo případ typu union {0} nemá pole s názvem {1}.
@@ -7067,6 +7067,21 @@
This type does not inherit Attribute, it will not work correctly with other .NET languages.
+
+
+ The exception '{0}' does not have a field named '{1}'.
+
+
+
+
+ The constructor does not have a field named '{0}'.
+
+
+
+
+ Active patterns do not have fields. This syntax is invalid.
+
+