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; } }