Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit53f022a

Browse files
dsymeKevinRansom
authored andcommitted
Type extensions should throw a more descriptive error (#3248)
1 parent770320b commit53f022a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎src/fsharp/FSComp.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ tcTypeAbbreviationHasTypeParametersMissingOnType,"This type abbreviation has one
789789
954,tcTypeDefinitionIsCyclicThroughInheritance,"This type definition involves an immediate cyclic reference through a struct field or inheritance relation"
790790
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"
791791
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."
792-
957,tcDeclaredTypeParametersForExtensionDoNotMatchOriginal,"Thedeclared type parameters for this type extensiondo not match the declared typeparameters onthe original type '%s'"
792+
957,tcDeclaredTypeParametersForExtensionDoNotMatchOriginal,"One or more of thedeclared type parameters for this type extensionhave a missing or wrong typeconstraint not matchingthe original type constraints on '%s'"
793793
959,tcTypeDefinitionsWithImplicitConstructionMustHaveOneInherit,"Type definitions may only have one 'inherit' specification and it must be the first declaration"
794794
960,tcTypeDefinitionsWithImplicitConstructionMustHaveLocalBindingsBeforeMembers,"'let' and 'do' bindings must come before member and interface definitions in type definitions"
795795
961,tcInheritDeclarationMissingArguments,"This 'inherit' declaration specifies the inherited type but no arguments. Consider supplying arguments, e.g. 'inherit BaseType(args)'."

‎tests/fsharp/typecheck/sigs/neg22.bsl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ but given a
3333
'float<kg>'
3434
The unit of measure 'm' doesnot match the unit of measure 'kg'
3535

36-
neg22.fs(28,12,28,18): typecheck error FS0957:Thedeclared type parametersfor this type extensiondonot match the declared typeparameters onthe original type 'LibGen<_>'
36+
neg22.fs(28,12,28,18): typecheck error FS0957:Oneor more of thedeclared type parametersfor this type extensionhave a missingor wrong typeconstraintnot matchingthe original type constraints on 'LibGen<_>'
3737

38-
neg22.fs(40,12,40,18): typecheck error FS0957:Thedeclared type parametersfor this type extensiondonot match the declared typeparameters onthe original type 'LibGen<_>'
38+
neg22.fs(40,12,40,18): typecheck error FS0957:Oneor more of thedeclared type parametersfor this type extensionhave a missingor wrong typeconstraintnot matchingthe original type constraints on 'LibGen<_>'
3939

4040
neg22.fs(33,17,33,19): typecheck error FS0341: The signatureand implementation arenot 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 signatureor add itto the implementation.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp