sys::Obj compiler::CompilerSupport compiler::CompilerStep compiler::ClosureToImmutable
ClosureToImmutable processes each closure to determine its immutability. At this point, all the enclosed variables have been mapped to fields by ClosureVars. So we have three cases:
Bool isAlwaysImmutable(TypeDef cls)
Are all the fields known to be const types?
Str? isNeverImmutable(TypeDef cls)
Are any of the fields known to never be immutable? If any field is not immutable, then return meaningful error message.
new make(Compiler compiler)
virtual override Void run()
Void setAllFieldsConst(TypeDef cls)
Set const flag on every field def.
compiler 1.0.82∙26-Jun-2025 Thu 13:18:36 EDT