Class AssertPanicExpressionOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase3.AssertPanicExpressionOrError
- All Implemented Interfaces:
Consumer<EK9Parser.AssertPanicExpressionContext>
final class AssertPanicExpressionOrError
extends TypedSymbolAccess
implements Consumer<EK9Parser.AssertPanicExpressionContext>
Validates assertPanic expression - the test-only counterpart to assertThrows that traps an
org.ek9.lang::Panic.
Two differences from AssertThrowsExpressionOrError:
- There is no type argument -
Panicis a single fixed type - so there is noTYPE_MUST_EXTEND_EXCEPTIONcheck (that gate is exactly what keeps a plainassertThrows(Panic, ...)from compiling; assertPanic is the sanctioned door). - The expression-form result type is fixed to
org.ek9.lang::Panicsop <- assertPanic(...)typespasPanic(exposingmessage()/exitCode()).
Like the other assert-family constructs it is dev-source only; using it in production (non-dev)
source is TEST_CONSTRUCT_IN_NON_DEV_SOURCE.
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionAssertPanicExpressionOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener) -
Method Summary
Methods inherited from class TypedSymbolAccess
getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
AssertPanicExpressionOrError
AssertPanicExpressionOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<EK9Parser.AssertPanicExpressionContext>
-