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
3 changes: 2 additions & 1 deletion src/Compiler/Checking/CheckExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2169,7 +2169,8 @@ module GeneralizationHelpers =
match memberFlags.MemberKind with
// can't infer extra polymorphism for properties
| SynMemberKind.PropertyGet
| SynMemberKind.PropertySet ->
| SynMemberKind.PropertySet
| SynMemberKind.PropertyGetSet ->
if not (isNil declaredTypars) then
errorR(Error(FSComp.SR.tcPropertyRequiresExplicitTypeParameters(), m))
| SynMemberKind.Constructor ->
Expand Down
18 changes: 12 additions & 6 deletions tests/fsharp/typecheck/sigs/neg32.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,20 @@ neg32.fs(55,18,55,20): typecheck error FS0039: The type parameter 'T is not defi

neg32.fs(56,18,56,20): 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(57,4,57,38): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.

neg32.fs(59,10,59,12): typecheck error FS0039: The type parameter 'T is not defined.
neg32.fs(58,4,58,33): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.

neg32.fs(62,11,62,13): typecheck error FS0039: The type parameter 'T is not defined.
neg32.fs(59,4,59,33): typecheck error FS0671: A property cannot have explicit type parameters. Consider using a method instead.

neg32.fs(62,11,62,13): typecheck error FS0039: The type parameter 'T is not defined.
neg32.fs(62,10,62,12): 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(62,10,62,12): typecheck error FS0039: The type parameter 'T is not defined.

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<_,_>'.
neg32.fs(65,11,65,13): typecheck error FS0039: The type parameter 'T is not defined.

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

neg32.fs(69,65,69,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(69,21,69,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<_,_>'.
3 changes: 3 additions & 0 deletions tests/fsharp/typecheck/sigs/neg32.fs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ type NegativeClass() =
abstract M2 : 'T with get, set
abstract M3 : 'T with set
abstract M4 : 'T with get
abstract M5<'T> : 'T with get, set
abstract M6<'T> : 'T with set
abstract M7<'T> : 'T with get

type NegativeRecord =
{ v : 'T }
Expand Down