Class ExactSingleParameter
java.lang.Object
org.ek9lang.compiler.support.ExactSingleParameter
- All Implemented Interfaces:
BiPredicate<MethodSymbol, ISymbol>
public final class ExactSingleParameter
extends Object
implements BiPredicate<MethodSymbol, ISymbol>
THE test "this method or operator takes exactly ONE parameter, and its type is EXACTLY this type" - by
isExactSameType, never by assignability. Hold one and ask it: the question a copy constructor
(CopyConstructor), a copy operator :=: taking exactly its owner
(SelfCopy) and the nearest-operator lookup
(DeclaredOperator) each asked in their own words (front-end
rationalisation X-3).
Deliberately NOT sameness/TakesItself (behind HasOwnComparator), which asks "is the owner ASSIGNABLE
to the parameter type" - a comparison against a trait or a super is still a comparison with itself there. And not
IsSelfComparison, which is the same assignable rule. Two questions,
two answers; never a third.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleantest(MethodSymbol method, ISymbol type) True whenmethodtakes exactly one parameter whose type is exactlytype.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiPredicate
and, negate, or
-
Constructor Details
-
ExactSingleParameter
public ExactSingleParameter()
-
-
Method Details
-
test
True whenmethodtakes exactly one parameter whose type is exactlytype.- Specified by:
testin interfaceBiPredicate<MethodSymbol, ISymbol>
-