Constructed Types and subtyping
Constructed types and subtyping is unpredictable The intended behavior should be * declared * documented * implemented
see for example the weird behavior in the attachment
Comments (7)
-
reporter -
reporter other related remark, now constructed types can be subtypes of string...
-
-
assigned issue to
-
assigned issue to
-
-
Solved by not allowing any constructed type to be a subtype, and only allowing other types to be declared as a subtype of a constructed type. E.g.:
type T isa T2 constructed from {...}
type T constructed from {...} contains T2
type T constructed from {...} | type T2 contains T
are NOT allowed, but:
type T constructed from {...} | type T2 isa T
IS allowed.
-
Remark: fix includes not enabling "isa" or "contains" in conjunction with "constructed from" by the parser. So you will get a parsing error in those cases. An "not allowed to use constructed types as subtype"-error will be thrown in the case of "T2 contains ConstrType".
-
- changed status to resolved
resolved by 19ff2dc1456118bb456e2b233ea6dbed5e3e8cd3
- Log in to comment
Also, in cases that are not handled, the exceptions should be more clear:
not "Addition of domain elements to a constructed sort is not yet implemented." but "subtypes of constructed types are not supported" or something like that