Problem with generic domain
Posted: 20 Feb 2018 20:36
Hello Thomas,
please check this stripped down version of my code. It throws fatal error c098 : Place was not set (in VIP 8 build 801).
When uncommenting the hasDomain line, the message changes to error c504 : The expression has type '(someTypes::rec*) -> @Type procedure', which is incompatible with the type '(someTypes::rec{@Type}*) -> @Type procedure'. Trying to strip down the problem further, I found that following short code produces same kind of error.
please check this stripped down version of my code. It throws fatal error c098 : Place was not set (in VIP 8 build 801).
Code: Select all
interface someTypes{@Type}
domains
rec = rec(@Type).
domains
valueProvider = (rec*) -> @Type Value.
end interface someTypes
%======
interface objA
end interface objA
%---
class objA{@Type} : objA
open someTypes{@Type}
constructors
new : (valueProvider).
end class objA
%---
implement objA{@Type}
clauses
new(_ProvideValue).
end implement objA
%======
interface objB{@Type}
domains
useTypeToPreventWarning = @Type.
end interface objB
%---
class objB{@Type} : objB{@Type}
end class objB
%---
implement objB{@Type}
open someTypes{@Type}
clauses
new() :-
%hasDomain(valueProvider, ProvideValue),
ProvideValue = { (RecList) = Val :- [rec(Val)] == RecList },
_ObjA = objA::new(ProvideValue).
end implement objB
%======
implement main
clauses
run() :-
_ObjB = objB::new().
end implement main
Code: Select all
interface someTypes{@Type}
domains
rec = rec(@Type).
end interface someTypes
implement main
clauses
run() :-
hasDomain(someTypes{unsigned}::rec, _Rec).
end implement main