Modules do not work

In a production project, I reference the Microsoft.VisualBasic.dll, what means that the class My is generated by the compiler.

This works, but suddenly all My.xxx statements do not compile anymore.

Part of the compiler generated code:

You see that the static class is generated with the [&Module] attribute, what means that it should behave as a Visual Basic Module that imports all members to the namespace level.

The namespace of this file:
image

So, a call to buildITAspects.My.Application should be translated to a call to buildITAspects.My.MyProject.Application.

This doesn’t work.
All calls to buildITAspects.My.Application fail.
All calls to buildITAspects.My.MyProject.Application succeed.

While they should both succeed.

The errors caused by this in this solution (which was working without a problem a few weeks ago):

The build log: build.log.txt (6.0 MB)

If you want the solution, I can send it by PM.

85107: Regression: [Module] stopped working

namespace ConsoleApplication6;

type
  Program = class
  public

    class method Main(args: array of String): Int32;
    begin
      writeLn('The magic happens here.');
      Foo.Bar;
      Bar; // E46 Unknown identifier "Bar"
    end;

  end;
  
  [&Module]
  Foo = public static class
  public
    class method Bar;
    begin
      
    end;
  end;

end.
1 Like