mita icon indicating copy to clipboard operation
mita copied to clipboard

Global variables are not in setup scopes

Open wegendt-bosch opened this issue 6 years ago • 1 comments

The following code can not resolve addr:

package test;

import platforms.xdk110;

let addr = "localhost";

setup endpoint: WLAN {
	psk = addr;
	ssid = addr;
}

While in this case it might not be hugely useful to define addr outside the setup, in other cases it might be, for example when doing arithmetic with register addresses for I2C.

wegendt-bosch avatar Apr 25 '18 14:04 wegendt-bosch

@32leaves: We should allow only constants whose values we can infer using the StaticValueInferrer.

wegendt-bosch avatar Apr 25 '18 14:04 wegendt-bosch