Class IterationSourceLowering

java.lang.Object
org.ek9lang.compiler.phase7.generator.AbstractGenerator
org.ek9lang.compiler.phase7.generator.IterationSourceLowering

final class IterationSourceLowering extends AbstractGenerator
THE lowering of an iteration SOURCE - shared by for x in source (ForInGenerator) and a stream's cat source (StreamStatementGenerator); use it, never a third copy.

The source is an expression evaluated into a fresh managed temp, or - when the expression names an enumeration TYPE, a base enum or a CONSTRAINED one (IsEnumerationType) - an unset instance of that type made by its default constructor, whose iterator() yields the enumeration's own values (a constrained enum's subset). The two generators used to decide "is it an enumeration" differently: the stream tested only for a base enum, so cat RedSuit loaded the type name as a local and failed JVM verification (runtimeFuzz streamCatConstrainedEnum).