Class InternalErrorTrigger
-Dek9.internalError.at=<PHASE> on the compiling JVM (a CompilationPhase name, e.g.
FULL_RESOLUTION or CODE_GENERATION_AGGREGATES) the compiler throws a plain
RuntimeException at the START of that phase, after the phase has been recorded as entered - so the
CLI's internal-error report names it, and exits INTERNAL_ERROR_EXIT_CODE (14).
It exists so the end-to-end proof of that report (InternalCompilerErrorE2ETest) does not depend on a
source the compiler happens to mishandle today: every such source is a defect waiting to be fixed, and fixing it
used to break the test. The property is read ONCE, when this class is loaded, the way ek9.lockMetrics
and ek9.absent.strict are read; it is off by default and nothing in EK9 source can reach it. An unknown
phase name is refused loudly (an IllegalArgumentException naming the valid ones) rather than silently
never firing.
Checked in ONE place, the driver (Ek9Compiler), right after it records a phase as entered - for every
phase, READING and PARSING included (Q11) - so the CLI's report names the phase that failed.
The language's own bootstrap compile (Ek9LanguageBootStrap, which runs the front end up to
PLUGIN_RESOLUTION over the built-in modules before the developer's source is read) is exempt: the failure lands in
the developer's compile, where the program has entered the phase and the report can name it.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription(package private) static CompilationPhasephaseNamed(String value) The phase a property value names: null when it is unset or blank, the phase when it is a phase name.static voidThrow the requested internal error ifphaseis the one named by "ek9.internalError.at".(package private) static booleanwhileBootstrapping(BooleanSupplier bootstrapCompile) Run the language's bootstrap compile, which the trigger never fires in (see the class comment).
-
Field Details
-
PROPERTY
The JVM system property that names the phase to fail at.- See Also:
-
-
Method Details
-
throwIfRequestedAt
Throw the requested internal error ifphaseis the one named by "ek9.internalError.at". -
whileBootstrapping
Run the language's bootstrap compile, which the trigger never fires in (see the class comment). -
phaseNamed
The phase a property value names: null when it is unset or blank, the phase when it is a phase name.
-