WARNING: Cannot determine if container access is using container type

Hello brains trust,

Need some help please.  I receive the compiler warning "Cannot determine if container access is using container type" when using STRICT type checking on the following excerpt of code.  Mind you, the code still runs.

BUT, I can't figure out how to eliminate the warning (it's messing with my OCD).  What am I missing?

function test() as Void {
	var w = null, ti, sz = 6;

	w = Weather.getHourlyForecast();
	if (w != null) {
		for (var j=0; j<sz; j++) {
			ti = Gregorian.info((w[j].forecastTime as Moment), (Time.FORMAT_LONG as DateFormat));
		    // ... more code follows, but irrelevant for this illustration
		}
	}	

}	

  • To get rid of the container type warnings, you need to add the following type casts/declarations:

    - points, right-hand side of coords = as Array<Graphics.Point2D> 

    - right-hand side of coords[i] = as Graphics.Point2D

    I added the other types for completeness.

    function FillPolygon(
        dc as Graphics.Dc,
        sx as Number,
        sy as Number,
        dx as Number,
        dy as Number,
        theta as Numeric,
        points as Array<Graphics.Point2D>
    ) as Void {
      	theta = theta / 360.0 * 2 * Math.PI;
    	var sin = Math.sin(theta);
    	var cos = Math.cos(theta);
    	
    	var coords = new [points.size()] as Array<Graphics.Point2D>;
    	for (var i = 0; i < points.size(); ++i) {
        	// make a copy so as to not modify the points array
        	coords[i] = [points[i][0] * sx, points[i][1] * sy] as Graphics.Point2D;
        	
        	var x = (coords[i][0] * cos) - (coords[i][1] * sin) + dx;
        	var y = (coords[i][0] * sin) + (coords[i][1] * cos) + dy;
        	
        	coords[i][0] = x;
        	coords[i][1] = y;
        }
    
    	dc.fillPolygon(coords);
    }

  • function initialize(params) {
    Drawable.initialize(params);
    deviceSettings = System.getDeviceSettings();
    screenWidth = deviceSettings.screenWidth;
    screenHeight = deviceSettings.screenHeight;
    origX = params[:x];
    origY = params[:y];
    origColor = params[:color];
    gIconsFont = Ui.loadResource(Rez.Fonts.IconsFont);
    onePercent = screenWidth / 100.0;
    }

    i am having the same error on these lines:

    origX = params[:x];
    origY = params[:y];
    origColor = params[:color];


    Cannot determine if container access is using container type.