Class ParameterisedFunctionCallOrError
- All Implemented Interfaces:
Consumer<PossibleGenericSymbol>
When a generic function like selectFirst() of type (A, B) is parameterised with concrete
types (e.g., A=String, B=Integer), the type arguments are bound positionally from the call site.
After type substitution, the function parameters have concrete types. This check verifies that
each type argument (which represents the call argument type) is assignable to or promotable to
the corresponding substituted parameter type.
Only parameters whose substituted type is directly one of the type arguments are checked.
Parameters using complex type expressions (e.g., List of T becoming List of Integer)
are skipped because the type argument does not directly represent the call argument type for
that parameter position.
Without this check, mismatches are only detected at IR generation where the ParameterPromotionProcessor crashes with a CompilerException instead of a proper diagnostic.
-
Constructor Details
-
ParameterisedFunctionCallOrError
ParameterisedFunctionCallOrError(ErrorListener errorListener)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<PossibleGenericSymbol>
-