Under Review
over 2 years ago

SDK 4.2.0 Beta 1 won't compile AppBase.getProperty

Given

  return Application.getApp().getProperty(s);
The compiler reports
  ERROR: fr235: test.mc: '$.Toybox.Application.AppBase.getProperty' is deprecated.
But fr235 doesn't support Application.Properties.getValue, so I *have* to use getProperty when compiling for fr235.
Parents
  • No it's not fine if deprecation of getproperty means removal.

    Sorry, I was thinking more generically: if a feature has been, or will be removed in newer devices, then deprecating it, followed by making it a compilation error (for such devices) makes sense.

    In fact I actually thought that was the case for getProperty; my impression was that it only worked on ciq-1.x devices, and that the newer apis *had* to be used in ciq-2.0 and later.

    But if it does indeed work everywhere, and has some advantages over the newer apis, then yes, I agree, it shouldn't be deprecated (although that's somewhat orthogonal to this issue, which is that type check level is being used to determine whether deprecated apis are errors or not).

Comment
  • No it's not fine if deprecation of getproperty means removal.

    Sorry, I was thinking more generically: if a feature has been, or will be removed in newer devices, then deprecating it, followed by making it a compilation error (for such devices) makes sense.

    In fact I actually thought that was the case for getProperty; my impression was that it only worked on ciq-1.x devices, and that the newer apis *had* to be used in ciq-2.0 and later.

    But if it does indeed work everywhere, and has some advantages over the newer apis, then yes, I agree, it shouldn't be deprecated (although that's somewhat orthogonal to this issue, which is that type check level is being used to determine whether deprecated apis are errors or not).

Children
  • In fact I actually thought that was the case for getProperty; my impression was that it only worked on ciq-1.x devices, and that the newer apis *had* to be used in ciq-2.0 and later.

    I think I see my confusion. If you're using it to get properties controlled by settings, then you *have* to use Application.Properties.getValue on newer devices; but if you're just using it as generic storage, you can choose between getProperty and Storage.getValue.