Compiler error when using excludeAnnotations in AppBase and background is present

Description:

If you have different declarations of the same function (decorated with excludeAnnotations) in your AppBase class
Then the compiler generates an error if you have a background ServiceDelegate (annotated with (:background)) in your project.
When removing the background ServiceDelegate from the project, the compiler compiles fine and the excludeAnnotations behave as expected.

Environment:
Mac High Sierra 10.13.3
Eclipse Oxygen.2

Steps to reproduce:

Import attached project in Eclipse
Try to compile and observe compiler error

Remove the background ServiceDelegate (BgDelegate.mc) and compile again
Observe no error and build succeeds.

Expected results:

excludeAnnotations for different versions of the same method (foo()) inside the AppBase class should be handled correctly when the project contains a background ServiceDelegate (BgDelegate.mc).

When selecting FR 935 as target, output on the console should be "Version 1"
When selecting Fenix 5 as target, output on the console should be "Version 2"

Observed results:

The following compiler error is produced:

BUILD: ERROR: fr935: ERROR: assembler: Redefinition of label (code) globals_TestExcludeAnnotationsApp_foo
BUILD: ERROR: fr935: ERROR: assembler: Redefinition of label (code) globals_TestExcludeAnnotationsApp_foo_end
BUILD: ERROR: fr935: ERROR: assembler: Cannot resolve label strVersion_2_596863690

BUILD: WARNING: fr935: The entry point globals.TestExcludeAnnotationsApp was implicitly added to the Background process since it contains declarations annotated with (:background). (background application)

  • The compiler error also happens if I try to do the same thing in the background ServiceDelegate.

    The AppBase class is implicitly added to the background process (as seen in the warning below the error message), and since it is in the AppBase class where I encountered the issue first, having the same issue in the background ServiceDelegate makes me believe that this bug happens for any (:background) annotated classes.
  • it's the same when you explicitly add the background annotation

    (:background)
    class DataLoverApp extends App.AppBase {

    ...

    (:has_1hz)
    function getInitialView() {
    return [ new DataLoverView(), new DataLoverDelegate() ];
    }

    (:not_1hz)
    function getInitialView() {
    return [ new DataLoverView() ];
    }

    ...


    BUILD: ERROR: ERROR: assembler: Redefinition of label (code) globals_DataLoverApp_getInitialView
    BUILD: ERROR: ERROR: assembler: Redefinition of label (code) globals_DataLoverApp_getInitialView_end
  • Okay, I was able to reproduce/confirm this is still a problem. It looks like we do have a fix for it, but it hasn't made it into a production release. I don't think it will make it into the next release, but we're planning to get it into the release after the next. :)
  • Okay, I was able to reproduce/confirm this is still a problem. It looks like we do have a fix for it, but it hasn't made it into a production release. I don't think it will make it into the next release, but we're planning to get it into the release after the next. :)


    Thanks Brandon!