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

A type checking issue

Unread post by Martin Meyer »

Hello Thomas,

my program has thrown an access violation. I have stripped the issue down to a small demo:

Create a new "console application"-project (in VIP 7.4 build 7402) and put this code to main.pro

Code: Select all

interface myObj     open core   domains     testPredicate = (integer, tuple{integer, integer}).   properties     test : testPredicate (o).   end interface myObj   %----   class myObj : myObj     open core   constructors     new : (testPredicate).   end class myObj   %----   implement myObj     open core   facts     test : testPredicate.   clauses     new(Test):-         test := Test.   end implement myObj   %====   implement main     open core   class predicates     doNothing : (AnyDomain, AnyDomain). clauses     doNothing(_, _).   clauses     run():-         console::init(),         MyObj == myObj::new({ (A, B):- doNothing(A, B) }),         MyObj:test(1, tuple(1, 2)).   end implement main   goal     mainExe::run(main::run).
When running it, the call to doNothing/2 throws the access violation. I suppose, VIP's intended behavior would be a type mismatch error at compile time.

Best regards,
Martin
User avatar
Thomas Linder Puls
VIP Member
Posts: 1398
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

Yes, this is a bug. Thank you for reporting it.
Regards Thomas Linder Puls
PDC
Post Reply