Class CoverageSourceQualifiedName

java.lang.Object
org.ek9lang.compiler.phase7.generator.CoverageSourceQualifiedName
All Implemented Interfaces:
Function<ISymbol,String>

public final class CoverageSourceQualifiedName extends Object implements Function<ISymbol,String>
THE fully-qualified name to use as a coverage/profiling IDENTITY for a callable - stable across every parameterisation of a generic. Hold an instance; FunctionProbes.enter(CoverageProbePlacer, ISymbol, DebugInfo) registers every callable under it.

Why this exists (defect D11). EK9 monomorphises, so Holder of String and Holder of Integer are separate aggregates with mangled names. A METHOD's getFullyQualifiedName() does not carry its owning type, so two parameterisations already agree - but a CONSTRUCTOR's name IS its type's name, which is the mangled one, so the two disagree and one source constructor acquires an identity per parameterisation. Probe and function ids hash this name, so the effect is a denominator counting the same source constructor N times.

Coverage is deliberately TYPE-BLIND: it answers "did this source line ever execute", and EK9 has no instanceof or casts, so a generic body cannot branch on its type argument. Type breadth is the separate input-variety axis's job. Hence the generic's own name, NOT getFriendlyName(), which would append the type arguments and split the identity again.

🔑 Resolved from the SYMBOL (PossibleGenericSymbol.getGenericType()), never by un-mangling the string. FriendlyInternalName is the display-only transform and says so: it reduces every dynamic class and function to cls/fn, which would make two dynamic constructs in one module collide as one identity.

  • Constructor Details

    • CoverageSourceQualifiedName

      public CoverageSourceQualifiedName()
  • Method Details

    • apply

      public String apply(ISymbol operationSymbol)
      The coverage/profiling identity of a callable.
      Specified by:
      apply in interface Function<ISymbol,String>
      Parameters:
      operationSymbol - the symbol whose identity is needed; must not be null
      Returns:
      the fully-qualified name, with a parameterised type's constructor named for its generic