Error e353 "Free parameter is used in type expression"

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

Error e353 "Free parameter is used in type expression"

Unread post by Martin Meyer » 30 Mar 2013 14:24

Hi Thomas (Linder Puls), hi all,

please take a look at the four in certain manner nested object types below. On compilation (in VIP 7.4 build 7401) the code throws error e353 "Free parameter '@Type' is used in type expression". Is it a bug? If not, please explain why the error is correct.

Regards + Happy Easter!
Martin

Code: Select all

interface typeA{@Type}     domains         someType = @Type. end interface typeA   class typeA{@Type} : typeA{@Type} end class typeA   implement typeA{@Type} end implement typeA %------------------------------------ interface typeB{@Type}     properties         myProperty : typeA{@Type} (o). end interface typeB   class typeB{@Type} : typeB{@Type} end class typeB   implement typeB{@Type}     facts         myProperty : typeA{@Type} := typeA::new(). end implement typeB %------------------------------------ interface typeC     supports typeB{typeC} end interface typeC   class typeC : typeC end class typeC   implement typeC     inherits typeB{typeC} end implement typeC %------------------------------------ interface typeD     properties from typeC         myProperty end interface typeD   class typeD : typeD end class typeD   implement typeD     inherits typeC end implement typeD

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

Unread post by Thomas Linder Puls » 30 Mar 2013 18:32

It looks like a bug. The message is caused by the "properties from":

Code: Select all

interface typeA{@Type}     domains         someType = @Type. end interface typeA   interface typeB{@Type}     properties         myProperty : typeA{@Type} (o). end interface typeB   interface typeC     supports typeB{typeC} end interface typeC   interface typeD     properties from typeC         myProperty  % this cause the problem end interface typeD
We will of course look at it.
Regards Thomas Linder Puls
PDC

Peter Muraya
VIP Member
Posts: 147
Joined: 5 Dec 2012 7:29

Free parameter is used in type expression

Unread post by Peter Muraya » 30 Mar 2015 14:03

Hi,
It does not look like this error e353 was sorted out completely when dealing with a chain of supported interfaces. Or was it? I have the same problem as earlier reported by Martin. See the code below. The commented line, as suggested by Thomas in a later post, solved the problem, but it makes the code less tidy than it should be.

Code: Select all

interface integration{@Product}      predicates           /*           Save the product inside the integration object*/           save:(@Product). end interface     interface transformation{@Source, @Product} supports integration{@Product}      predicates           /*           Sources of data for transformation.*/           sources:()->@Source nondeterm. end interface     interface assignment{@Source, @Data,  @Store} supports transformation{@Source, assignment_type}      domains           assignment_type = assignment{@Source, @Data,  @Store}.   end interface   interface assignment_support{@Source, @Data, @Store}        open assignment{@Source, @Data, @Store}        predicates from assignment{@Source, @Data, @Store}      %predicates from transformation{@Source, assignment_type}             /*           The sources of assignment inputs are the products of the caller*/           sources/0->,           /*           By default, products of assignment are saved in the assignment-support's local database*/           save/1   end interface   goal     succeed().
Mutall Data Management Technical Support

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

Unread post by Thomas Linder Puls » 30 Mar 2015 17:10

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

Post Reply