Bounded polymorphism problem

Discussions related to Visual Prolog
Martin Meyer
VIP Member
Posts: 264
Joined: 14 Nov 2002 0:01

Bounded polymorphism problem

Unread post by Martin Meyer » 17 May 2019 15:54

Hello Thomas,

this works (in build 902):

Code: Select all

class predicates     p : () -> Dom         where Dom supports integer. clauses     p() = 1 + 0.
But with these variants there is some problem:

Code: Select all

class predicates     p1 : () -> Dom         where Dom supports integer. clauses     p1() = 1.  % raises: 1 is not in the domain 'Dom'   class predicates     p2 : (integer) -> Dom         where Dom supports integer. clauses     p2(X) = X.  % raises: The expression has type '::integer', which is incompatible with the type 'Dom'
Regards Martin

User avatar
Thomas Linder Puls
VIP Member
Posts: 2407
Joined: 28 Feb 2000 0:01

Re: Bounded polymorphism problem

Unread post by Thomas Linder Puls » 18 May 2019 22:07

Thank you, we will look at it.
Regards Thomas Linder Puls
PDC

Post Reply