Acknowledged

SDK 8.0.0. BETA Language Server reports Info object as ambiguous even when properly qualified

Because of the quirkiness of the null checking with the Monkey C compiler, there are instances where I need to help the compiler. In the example below, the compiler thinks that the variable _posInfo is a polytype of either an Position.Info or Null. To clarify that it is indeed not null, I specify the type as Position.Info.

var altitude = (_posInfo as Position.Info).altitude;

However, when I do this, I get the following error:

fenix7: 'Info' is ambiguious and exists in multiple imported modules [$.Toybox.Position.Info, $.Toybox.Sensor.Info, $.Toybox.Activity.Info].

I have imported the three modules mentioned, but compiler seems to be ignoring the fact that I qualified the Info object as "Position.Info". Even if I completely qualify it as "$.Toybox.Position.Info" the error persists.

Parents
  • I did find that turning off type checking doesn't make this error go away. (I tried turning it off both via monkey.jungle and User Settings > Monkey C)

    It's strange since both the documentation and the VSC extension suggest that the language server build process uses the configured type checking level.

    For example, if I turn off type checking in User Settings > Monkey C, the Monkey C extension gives me the following notification:

    "Turn on type checking to access all the Monkey C language features."

Comment
  • I did find that turning off type checking doesn't make this error go away. (I tried turning it off both via monkey.jungle and User Settings > Monkey C)

    It's strange since both the documentation and the VSC extension suggest that the language server build process uses the configured type checking level.

    For example, if I turn off type checking in User Settings > Monkey C, the Monkey C extension gives me the following notification:

    "Turn on type checking to access all the Monkey C language features."

Children
No Data