Community
Participate
Working Groups
A bad type is converted to OclInvalid by the CS2AS. This suppresses the normal editor warning from an unresolved proxy. Perhaps Pivot.ocl should detect it.
(In reply to Ed Willink from comment #0) > Perhaps Pivot.ocl should detect it. A simple context TypedElement inv TypeIsNotInvalid : type <> OclInvalid causes 38 OCL test failures. A problem is that e.g. ExpressionInOCL may have a null type when the body has not been parsed to a bodyExpression. ?? null <> OclInvalid should not be invalid
(In reply to Ed Willink from comment #1) > ?? null <> OclInvalid should not be invalid A CG bug in the Type special casing. Once this is fixed there are 9 failures, mostly/all on InvalidLiteralExp that has a legitimate OclInvalid type. Constraint overriding is unspecified in OCL, so pragmatically we might just dp context InvalidLiteralExp inv TypeIsNotInvalid : type = OclInvalid to hide the 'bad' inherited constraint. But Eiffel's Design by Contract principles are a good guide to what we could be trying to do: "Class invariants are inherited, that is, 'the invariants of all the parents of a class apply to the class itself.'" The invariant will have to be pushed down to where it is unconditionally valid.
(In reply to Ed Willink from comment #0) > A bad type is converted to OclInvalid by the CS2AS. This suppresses the > normal editor warning from an unresolved proxy. This is an inline conversion that hides the proxy and is contrary to the working use of Xtext policy. All proxy access methods must return proxies when unresolved.