Acknowledged

BUG: Unable to detect scope for the symbol reference 'yourprivatemembernamehere' on private members

Private members of a class expose a weird bug in the typechecking logic of CIQ. Please look at the following class that exposes the following warning on *only* the private member of the class. Public and protected members to not trigger the warning:

WARNING: fenix6xpro: /home/ciq/src/source/bugs/SymbolRefBug.mc:19: Unable to detect scope for the symbol reference 'collision'.
WARNING: fenix6xpro: /home/ciq/src/source/bugs/SymbolRefBug.mc:20: Unable to detect scope for the symbol reference 'collision'.

import Toybox.Lang;

class SymbolRefBug {

  public var noCollision;
  protected var alsoNoCollision;
  private var collision;

  function initialize(args as Dictionary) {

    if (!args.hasKey(:noCollision)) {
      args.put(:noCollision, 1);
    }

    if (!args.hasKey(:alsoNoCollision)) {
      args.put(:alsoNoCollision, 1);
    }

    if (!args.hasKey(:collision)) {
      args.put(:collision, 1);
    }

    System.println(args);

  }
}

This test exposes the warning:

(:test)
module TestSymbolRefBug {
using OPN.Test.More as t;
using Toybox.System as Sys;
import Toybox.Lang;

    (:test)
    function testSymbolRefBug(logger) {
      new SymbolRefBug({});
      return true;
    }
}

Parents
  • hi hi, back again. While trying to bisect some behaviour changes I found that CIQ 6.4.0 now emits a warning when you have this kind of setup:

    WARNING: fenix6xpro: /home/ciq/src/source/bugs/SymbolRefBug.mc:11: Member variable 'collision' is not used.
    WARNING: fenix6xpro: /home/ciq/src/source/bugs/SymbolRefBug.mc:24,4: The private symbol 'collision' will not be found when using the indirect lookup syntax ':collision'. Consider making 'collision' public / protected or use a direct reference 'self.collision'.
    WARNING: fenix6xpro: /home/ciq/src/source/bugs/SymbolRefBug.mc:25,6: The private symbol 'collision' will not be found when using the indirect lookup syntax ':collision'. Consider making 'collision' public / protected or use a direct reference 'self.collision'.

Comment
  • hi hi, back again. While trying to bisect some behaviour changes I found that CIQ 6.4.0 now emits a warning when you have this kind of setup:

    WARNING: fenix6xpro: /home/ciq/src/source/bugs/SymbolRefBug.mc:11: Member variable 'collision' is not used.
    WARNING: fenix6xpro: /home/ciq/src/source/bugs/SymbolRefBug.mc:24,4: The private symbol 'collision' will not be found when using the indirect lookup syntax ':collision'. Consider making 'collision' public / protected or use a direct reference 'self.collision'.
    WARNING: fenix6xpro: /home/ciq/src/source/bugs/SymbolRefBug.mc:25,6: The private symbol 'collision' will not be found when using the indirect lookup syntax ':collision'. Consider making 'collision' public / protected or use a direct reference 'self.collision'.

Children
No Data