Class ExactSingleParameter

java.lang.Object
org.ek9lang.compiler.support.ExactSingleParameter

public final class ExactSingleParameter extends Object
THE test "this method or operator takes exactly ONE parameter, and its type is EXACTLY this type" - by isExactSameType, never by assignability. The question a copy constructor (CopyConstructor), a copy operator :=: taking exactly its owner (PolymorphicCopy) and the nearest-operator lookup (InheritedOperators) each asked in their own words (front-end rationalisation X-3).

Deliberately NOT DefaultedComparisonDelegate's takesItself, 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 Sameness.isSelfComparison(IAggregateSymbol, MethodSymbol), which is the same assignable rule. Two questions, two answers; never a third.

  • Method Details

    • takes

      public static boolean takes(MethodSymbol method, ISymbol type)
      True when method takes exactly one parameter whose type is exactly type.