Added test revealing problem with code generation of named invariant types that are recursively defined
Fix: The IR constructor now handles the generation of a recursively defined named invariant type
Updates to test results (removing casts that have no effect in the generated code)
Updated Java code generation of the apply expression to avoid casts that have no effect