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
  • It doesn't, you can try it with foo as well, it doesn't emit a warning. Unless you private var foo it.

    You need to have it as a private var otherwise it doesn't emit the warning.

    And it looks to be the same bug as the one markw65 reported. But 7 months later nothing has changed, I don't even know if it is fixed.

Comment
  • It doesn't, you can try it with foo as well, it doesn't emit a warning. Unless you private var foo it.

    You need to have it as a private var otherwise it doesn't emit the warning.

    And it looks to be the same bug as the one markw65 reported. But 7 months later nothing has changed, I don't even know if it is fixed.

Children
No Data