Class QualifiedNameHint

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

public final class QualifiedNameHint extends Object
THE hint for a QUALIFIED name 'M::X' that did not resolve, when the X the user probably meant is only IMPORTED with 'references' - by module M, or by the module the name is used in.

A qualified name reaches only what its module DEFINES: 'references' are shorthand for unqualified names inside the importing module, never re-exported and never consulted for a qualified name (front-end audit FE52/FE62). Before that rule a qualified name that missed quietly fell back to a reference by short name; now it is an error, and this names where the symbol actually lives so a person or an AI can fix it in one step. Used by every site that reports an unresolved qualified name (E03030, E50001, E50010) so the wording is the same everywhere.

  • Method Details

    • forUnresolved

      public static String forUnresolved(ModuleScope fromModule, String name)
      An explanation to append to the error message, or an empty String when there is nothing to add.
      Parameters:
      fromModule - the module scope the name was used in (may be null - then there is no hint)
      name - the name as written; only a qualified name can get a hint