Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Compiler/Checking/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2185,7 +2185,9 @@ module GeneralizationHelpers =
| Some memberFlags ->
match memberFlags.MemberKind with
// can't infer extra polymorphism for properties
| SynMemberKind.PropertyGet | SynMemberKind.PropertySet -> false
| SynMemberKind.PropertyGet
| SynMemberKind.PropertySet
| SynMemberKind.PropertyGetSet -> false
// can't infer extra polymorphism for class constructors
| SynMemberKind.ClassConstructor -> false
// can't infer extra polymorphism for constructors
Expand Down
46 changes: 26 additions & 20 deletions tests/fsharp/typecheck/sigs/neg32.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,48 @@ neg32.fs(17,21,17,49): typecheck error FS0842: This attribute is not valid for u

neg32.fs(24,15,24,16): typecheck error FS0043: The member or object constructor 'TryParse' does not take 1 argument(s). An overload was found taking 2 arguments.

neg32.fs(39,17,39,19): typecheck error FS0039: The type parameter 'T is not defined.
neg32.fs(43,17,43,19): typecheck error FS0039: The type parameter 'T is not defined.

neg32.fs(40,4,40,23): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.
neg32.fs(44,4,44,23): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.

neg32.fs(40,21,40,23): typecheck error FS0039: The type parameter 'U is not defined.
neg32.fs(44,21,44,23): typecheck error FS0039: The type parameter 'U is not defined.

neg32.fs(41,21,41,23): typecheck error FS0039: The type parameter 'U is not defined.
neg32.fs(45,21,45,23): typecheck error FS0039: The type parameter 'U is not defined.

neg32.fs(41,27,41,29): typecheck error FS0039: The type parameter 'U is not defined.
neg32.fs(45,27,45,29): typecheck error FS0039: The type parameter 'U is not defined.

neg32.fs(42,18,42,20): typecheck error FS0039: The type parameter 'U is not defined.
neg32.fs(46,18,46,20): typecheck error FS0039: The type parameter 'U is not defined.

neg32.fs(42,24,42,26): typecheck error FS0039: The type parameter 'U is not defined.
neg32.fs(46,24,46,26): typecheck error FS0039: The type parameter 'U is not defined.

neg32.fs(46,17,46,19): typecheck error FS0039: The type parameter 'T is not defined.
neg32.fs(50,17,50,19): typecheck error FS0039: The type parameter 'T is not defined.

neg32.fs(47,4,47,23): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.
neg32.fs(51,4,51,23): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.

neg32.fs(47,21,47,23): typecheck error FS0039: The type parameter 'U is not defined.
neg32.fs(51,21,51,23): typecheck error FS0039: The type parameter 'U is not defined.

neg32.fs(48,21,48,23): typecheck error FS0039: The type parameter 'U is not defined.
neg32.fs(52,21,52,23): typecheck error FS0039: The type parameter 'U is not defined.

neg32.fs(48,27,48,29): typecheck error FS0039: The type parameter 'U is not defined.
neg32.fs(52,27,52,29): typecheck error FS0039: The type parameter 'U is not defined.

neg32.fs(49,18,49,20): typecheck error FS0039: The type parameter 'U is not defined.
neg32.fs(53,18,53,20): typecheck error FS0039: The type parameter 'U is not defined.

neg32.fs(49,24,49,26): typecheck error FS0039: The type parameter 'U is not defined.
neg32.fs(53,24,53,26): typecheck error FS0039: The type parameter 'U is not defined.

neg32.fs(52,10,52,12): typecheck error FS0039: The type parameter 'T is not defined.
neg32.fs(54,18,54,20): typecheck error FS0039: The type parameter 'T is not defined.

neg32.fs(52,10,52,12): typecheck error FS0039: The type parameter 'T is not defined.
neg32.fs(55,18,55,20): typecheck error FS0039: The type parameter 'T is not defined.

neg32.fs(55,11,55,13): typecheck error FS0039: The type parameter 'T is not defined.
neg32.fs(56,18,56,20): typecheck error FS0039: The type parameter 'T is not defined.

neg32.fs(55,11,55,13): typecheck error FS0039: The type parameter 'T is not defined.
neg32.fs(59,10,59,12): typecheck error FS0039: The type parameter 'T is not defined.

neg32.fs(59,65,59,86): typecheck error FS0033: The non-generic type 'System.EventArgs' does not expect any type arguments, but here is given 1 type argument(s)
neg32.fs(59,10,59,12): typecheck error FS0039: The type parameter 'T is not defined.

neg32.fs(59,21,59,27): typecheck error FS1091: The event 'Event1' has a non-standard type. If this event is declared in another CLI language, you may need to access this event using the explicit add_Event1 and remove_Event1 methods for the event. If this event is declared in F#, make the type of the event an instantiation of either 'IDelegateEvent<_>' or 'IEvent<_,_>'.
neg32.fs(62,11,62,13): typecheck error FS0039: The type parameter 'T is not defined.

neg32.fs(62,11,62,13): typecheck error FS0039: The type parameter 'T is not defined.

neg32.fs(66,65,66,86): typecheck error FS0033: The non-generic type 'System.EventArgs' does not expect any type arguments, but here is given 1 type argument(s)

neg32.fs(66,21,66,27): typecheck error FS1091: The event 'Event1' has a non-standard type. If this event is declared in another CLI language, you may need to access this event using the explicit add_Event1 and remove_Event1 methods for the event. If this event is declared in F#, make the type of the event an instantiation of either 'IDelegateEvent<_>' or 'IEvent<_,_>'.
9 changes: 8 additions & 1 deletion tests/fsharp/typecheck/sigs/neg32.fs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ type PositiveClass<'A>() =
abstract M<'T> : 'T -> 'T
abstract M2<'T> : 'T -> 'A
abstract M : 'U -> 'U

abstract M3 : 'A with get, set
abstract M4 : 'A with set
abstract M5 : 'A with get


type NegativeInterface =
abstract v : 'T
abstract M<'T> : 'U
Expand All @@ -47,6 +51,9 @@ type NegativeClass() =
abstract M<'T> : 'U
abstract M<'T> : 'U -> 'U
abstract M : ('U -> 'U)
abstract M2 : 'T with get, set
abstract M3 : 'T with set
abstract M4 : 'T with get

type NegativeRecord =
{ v : 'T }
Expand Down