提交 53f022af 编写于 作者: D Don Syme 提交者: Kevin Ransom (msft)

Type extensions should throw a more descriptive error (#3248)

上级 770320b5
......@@ -789,7 +789,7 @@ tcTypeAbbreviationHasTypeParametersMissingOnType,"This type abbreviation has one
954,tcTypeDefinitionIsCyclicThroughInheritance,"This type definition involves an immediate cyclic reference through a struct field or inheritance relation"
tcReservedSyntaxForAugmentation,"The syntax 'type X with ...' is reserved for augmentations. Types whose representations are hidden but which have members are now declared in signatures using 'type X = ...'. You may also need to add the '[<Sealed>] attribute to the type definition in the signature"
956,tcMembersThatExtendInterfaceMustBePlacedInSeparateModule,"Members that extend interface, delegate or enum types must be placed in a module separate to the definition of the type. This module must either have the AutoOpen attribute or be opened explicitly by client code to bring the extension members into scope."
957,tcDeclaredTypeParametersForExtensionDoNotMatchOriginal,"The declared type parameters for this type extension do not match the declared type parameters on the original type '%s'"
957,tcDeclaredTypeParametersForExtensionDoNotMatchOriginal,"One or more of the declared type parameters for this type extension have a missing or wrong type constraint not matching the original type constraints on '%s'"
959,tcTypeDefinitionsWithImplicitConstructionMustHaveOneInherit,"Type definitions may only have one 'inherit' specification and it must be the first declaration"
960,tcTypeDefinitionsWithImplicitConstructionMustHaveLocalBindingsBeforeMembers,"'let' and 'do' bindings must come before member and interface definitions in type definitions"
961,tcInheritDeclarationMissingArguments,"This 'inherit' declaration specifies the inherited type but no arguments. Consider supplying arguments, e.g. 'inherit BaseType(args)'."
......
......@@ -33,8 +33,8 @@ but given a
'float<kg>'
The unit of measure 'm' does not match the unit of measure 'kg'
neg22.fs(28,12,28,18): typecheck error FS0957: The declared type parameters for this type extension do not match the declared type parameters on the original type 'LibGen<_>'
neg22.fs(28,12,28,18): typecheck error FS0957: One or more of the declared type parameters for this type extension have a missing or wrong type constraint not matching the original type constraints on 'LibGen<_>'
neg22.fs(40,12,40,18): typecheck error FS0957: The declared type parameters for this type extension do not match the declared type parameters on the original type 'LibGen<_>'
neg22.fs(40,12,40,18): typecheck error FS0957: One or more of the declared type parameters for this type extension have a missing or wrong type constraint not matching the original type constraints on 'LibGen<_>'
neg22.fs(33,17,33,19): typecheck error FS0341: The signature and implementation are not compatible because the type parameter 'T' has a constraint of the form 'T :> System.ValueType but the implementation does not. Either remove this constraint from the signature or add it to the implementation.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册