Class RetractedComparatorUseOrError
- All Implemented Interfaces:
org.antlr.v4.runtime.tree.ParseTreeListener, EK9Listener
DefaultComparatorRecheckOrError retracts a bare-inferred <=>,<,<=,>,>= when a field's type
is not orderable, or the <=> above it is retracted (D55), so the operator is not generated. A use of
that operator (holderA <=> holderB) was resolved back in FULL_RESOLUTION (before the retraction), so
its bound CallSymbol still points at the now-retracted operator. This listener reports that as OPERATOR_NOT_DEFINED (E07620) - the
SAME outcome as a direct list <=> list: a comparison that cannot work is not available, so ordering
the wrapper is a compile error. Must run AFTER the retraction pass. Holds no shared state - safe in the
phase's parallel per-source walk.
D58 (Steve, 2026-10-21): every use of <=> asks the same rule, including the uses that call it without
naming it - the comparison coalescing operators <? >?, a sort
stage with no comparator, x in a ... b, a for range and a switch case
(case < limit, which calls the operator itself). Phase 3 accepted each against the bare
<=> before it was retracted, so each is judged here, on the operands' common type, the stream's element
type or the range's type, by OrderingAvailability.withdrawnOrdering(IAggregateSymbol, ISymbol)
(built on OrderingAvailability.orderingSurvives(MethodSymbol, ISymbol)). An unconstrained conceptual T has its own
conceptual <=>, so it is never judged here but where it is substituted (
phase4/ParameterisedTypeOrError); a T constrain by Base orders by Base's <=>, so where Base's is
retracted the use in the generic's body is E07620 here - no parameterisation of it could run, as a binary <
on it already reported.
-
Field Summary
Fields inherited from class AbstractEK9PhaseListener
symbolsAndScopes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidD63: a construction ofPriorityQueue of Xwith no comparator orders byX's<=>.voidAswitchcase such ascase < limitcalls the switched value's operator: the same rule as the binary operator it is written as.voidExit a parse tree produced byEK9Parser.expression().voidExit a parse tree produced byEK9Parser.forRange().voidD63:collect as PriorityQueue of Xconstructs the natural-order queue too.voidExit a parse tree produced byEK9Parser.streamPart().Methods inherited from class ScopeStackConsistencyListener
enterApplicationDeclaration, enterBlock, enterCatchStatementExpression, enterClassDeclaration, enterComponentDeclaration, enterDynamicClassDeclaration, enterDynamicFunctionDeclaration, enterDynamicVariableCapture, enterFinallyStatementExpression, enterForStatementExpression, enterFunctionDeclaration, enterIfStatement, enterInstructionBlock, enterMethodDeclaration, enterOperatorDeclaration, enterPackageBlock, enterRecordDeclaration, enterReturningParam, enterServiceDeclaration, enterServiceOperationDeclaration, enterSingleStatementBlock, enterStreamExpression, enterStreamStatement, enterSwitchStatementExpression, enterTernaryPart, enterTextBodyDeclaration, enterTextDeclaration, enterTraitDeclaration, enterTryStatementExpression, enterTypeDeclaration, enterWhileStatementExpressionMethods inherited from class AbstractEK9PhaseListener
exitApplicationDeclaration, exitBlock, exitCatchStatementExpression, exitClassDeclaration, exitComponentDeclaration, exitDynamicClassDeclaration, exitDynamicFunctionDeclaration, exitDynamicVariableCapture, exitFinallyStatementExpression, exitForStatementExpression, exitFunctionDeclaration, exitIfStatement, exitInstructionBlock, exitMethodDeclaration, exitModuleDeclaration, exitOperatorDeclaration, exitPackageBlock, exitRecordDeclaration, exitReturningParam, exitServiceDeclaration, exitServiceOperationDeclaration, exitSingleStatementBlock, exitStreamExpression, exitStreamStatement, exitSwitchStatementExpression, exitTernaryPart, exitTextBodyDeclaration, exitTextDeclaration, exitTraitDeclaration, exitTryStatementExpression, exitTypeDeclaration, exitWhileStatementExpression, getErrorListener, getParsedModule, isScopeStackEmpty, pullBlockTerminationUp, pullIfElseTerminationUp, pullSwitchCaseDefaultUp, pullTryCatchFinallyUpMethods inherited from class EK9BaseListener
enterAccessModifier, enterAggregateParts, enterAggregateProperty, enterAllowingOnly, enterApplicationBlock, enterArgumentParam, enterAspectDeclaration, enterAssertDoesNotThrowExpression, enterAssertPanicExpression, enterAssertStatement, enterAssertThrowsExpression, enterAssignmentExpression, enterAssignmentStatement, enterBinaryLit, enterBinaryLiteral, enterBlockStatement, enterBooleanLit, enterBooleanLiteral, enterBytesLit, enterBytesLiteral, enterCall, enterCaseExpression, enterCaseStatement, enterCharacterLit, enterCharacterLiteral, enterClassBlock, enterColourLit, enterColourLiteral, enterCompilationUnit, enterComponentBlock, enterConstantBlock, enterConstantDeclaration, enterConstantInitialiser, enterConstrainDeclaration, enterConstrainType, enterDateLit, enterDateLiteral, enterDateTimeLit, enterDateTimeLiteral, enterDeclareArgumentParam, enterDecorationDimensionLiteral, enterDecorationResolutionLiteral, enterDefaultOperator, enterDict, enterDimensionLit, enterDirective, enterDirectivePart, enterDottedName, enterDurationLit, enterDurationLiteral, enterDynamicFunctionBody, enterElseOnlyBlock, enterEmptyBlock, enterEnumerationDeclaration, enterEveryRule, enterExcludedControlFlowStatement, enterExcludedInstantiation, enterExcludedListComprehension, enterExcludedLiteral, enterExcludedParameters, enterExpression, enterExpressionParam, enterExtendDeclaration, enterExtendPreamble, enterFloatingPointLit, enterFloatingPointLiteral, enterForLoop, enterForRange, enterFunctionBlock, enterHttpAccess, enterHttpVerb, enterIdentifier, enterIdentifierReference, enterIfControlBlock, enterInitValuePair, enterIntegerLit, enterIntegerLiteral, enterList, enterMillisecondLit, enterMillisecondLiteral, enterModuleBlock, enterModuleDeclaration, enterModuleSegment, enterMoneyLit, enterMoneyLiteral, enterNonIdentifierOperator, enterObjectAccess, enterObjectAccessExpression, enterObjectAccessStart, enterObjectAccessType, enterOperationCall, enterOperationDetails, enterOperator, enterParameterisedArgs, enterParameterisedDetail, enterParameterisedParams, enterParameterisedType, enterParamExpression, enterPathLit, enterPathLiteral, enterPipelinePart, enterPreFlowAndControl, enterPreFlowStatement, enterPrimary, enterPrimaryReference, enterProgramBlock, enterRange, enterRecordBlock, enterReferencesBlock, enterRegExLit, enterRegisterStatement, enterRegularExpressionLiteral, enterRequireStatement, enterReservedWord, enterResolutionLit, enterSecurityConstraint, enterServiceBlock, enterSheBang, enterStatement, enterStreamCat, enterStreamExpressionTermination, enterStreamFor, enterStreamPart, enterStreamSource, enterStreamStatementTermination, enterStringLit, enterStringLiteral, enterStringPart, enterTextBlock, enterThrowStatement, enterTimeLit, enterTimeLiteral, enterTraitBlock, enterTraitPreamble, enterTraitReference, enterTraitsList, enterTypeBlock, enterTypeDef, enterVariableDeclaration, enterVariableOnlyDeclaration, enterVersionNumberLit, enterVersionNumberLiteral, enterWebVariableCorrelation, exitAccessModifier, exitAggregateParts, exitAggregateProperty, exitAllowingOnly, exitApplicationBlock, exitArgumentParam, exitAspectDeclaration, exitAssertDoesNotThrowExpression, exitAssertPanicExpression, exitAssertStatement, exitAssertThrowsExpression, exitAssignmentExpression, exitAssignmentStatement, exitBinaryLit, exitBinaryLiteral, exitBlockStatement, exitBooleanLit, exitBooleanLiteral, exitBytesLit, exitBytesLiteral, exitCaseStatement, exitCharacterLit, exitCharacterLiteral, exitClassBlock, exitColourLit, exitColourLiteral, exitCompilationUnit, exitComponentBlock, exitConstantBlock, exitConstantDeclaration, exitConstantInitialiser, exitConstrainDeclaration, exitConstrainType, exitDateLit, exitDateLiteral, exitDateTimeLit, exitDateTimeLiteral, exitDeclareArgumentParam, exitDecorationDimensionLiteral, exitDecorationResolutionLiteral, exitDefaultOperator, exitDict, exitDimensionLit, exitDirective, exitDirectivePart, exitDottedName, exitDurationLit, exitDurationLiteral, exitDynamicFunctionBody, exitElseOnlyBlock, exitEmptyBlock, exitEnumerationDeclaration, exitEveryRule, exitExcludedControlFlowStatement, exitExcludedInstantiation, exitExcludedListComprehension, exitExcludedLiteral, exitExcludedParameters, exitExpressionParam, exitExtendDeclaration, exitExtendPreamble, exitFloatingPointLit, exitFloatingPointLiteral, exitForLoop, exitFunctionBlock, exitHttpAccess, exitHttpVerb, exitIdentifier, exitIdentifierReference, exitIfControlBlock, exitInitValuePair, exitIntegerLit, exitIntegerLiteral, exitList, exitMillisecondLit, exitMillisecondLiteral, exitModuleBlock, exitModuleSegment, exitMoneyLit, exitMoneyLiteral, exitNonIdentifierOperator, exitObjectAccess, exitObjectAccessExpression, exitObjectAccessStart, exitObjectAccessType, exitOperationCall, exitOperationDetails, exitOperator, exitParameterisedArgs, exitParameterisedDetail, exitParameterisedParams, exitParameterisedType, exitParamExpression, exitPathLit, exitPathLiteral, exitPipelinePart, exitPreFlowAndControl, exitPreFlowStatement, exitPrimary, exitPrimaryReference, exitProgramBlock, exitRange, exitRecordBlock, exitReferencesBlock, exitRegExLit, exitRegisterStatement, exitRegularExpressionLiteral, exitRequireStatement, exitReservedWord, exitResolutionLit, exitSecurityConstraint, exitServiceBlock, exitSheBang, exitStatement, exitStreamCat, exitStreamFor, exitStreamSource, exitStreamStatementTermination, exitStringLit, exitStringLiteral, exitStringPart, exitTextBlock, exitThrowStatement, exitTimeLit, exitTimeLiteral, exitTraitBlock, exitTraitPreamble, exitTraitReference, exitTraitsList, exitTypeBlock, exitTypeDef, exitVariableDeclaration, exitVariableOnlyDeclaration, exitVersionNumberLit, exitVersionNumberLiteral, exitWebVariableCorrelation, visitErrorNode, visitTerminal
-
Constructor Details
-
RetractedComparatorUseOrError
RetractedComparatorUseOrError(ParsedModule parsedModule)
-
-
Method Details
-
exitExpression
Description copied from class:EK9BaseListenerExit a parse tree produced byEK9Parser.expression().The default implementation does nothing.
- Specified by:
exitExpressionin interfaceEK9Listener- Overrides:
exitExpressionin classEK9BaseListener- Parameters:
ctx- the parse tree
-
exitCaseExpression
Aswitchcase such ascase < limitcalls the switched value's operator: the same rule as the binary operator it is written as.- Specified by:
exitCaseExpressionin interfaceEK9Listener- Overrides:
exitCaseExpressionin classEK9BaseListener- Parameters:
ctx- the parse tree
-
exitCall
D63: a construction ofPriorityQueue of Xwith no comparator orders byX's<=>.- Specified by:
exitCallin interfaceEK9Listener- Overrides:
exitCallin classEK9BaseListener- Parameters:
ctx- the parse tree
-
exitStreamExpressionTermination
D63:collect as PriorityQueue of Xconstructs the natural-order queue too.- Specified by:
exitStreamExpressionTerminationin interfaceEK9Listener- Overrides:
exitStreamExpressionTerminationin classEK9BaseListener- Parameters:
ctx- the parse tree
-
exitStreamPart
Description copied from class:EK9BaseListenerExit a parse tree produced byEK9Parser.streamPart().The default implementation does nothing.
- Specified by:
exitStreamPartin interfaceEK9Listener- Overrides:
exitStreamPartin classEK9BaseListener- Parameters:
ctx- the parse tree
-
exitForRange
Description copied from class:EK9BaseListenerExit a parse tree produced byEK9Parser.forRange().The default implementation does nothing.
- Specified by:
exitForRangein interfaceEK9Listener- Overrides:
exitForRangein classEK9BaseListener- Parameters:
ctx- the parse tree
-