我的主应用程序包含一个ClassA
. 然后主应用程序加载一个模块,在该模块中我想做:
var classA:InterfaceClassA = new ClassA();
它编译得很好,但我收到了这个警告:
Warning: YourApplication is a module or application that is directly referenced. This will cause YourApplication and all of its dependencies to be linked in with module.YourModule:Module. Using an interface is the recommended practice to avoid this.
我不能使用接口来生成新实例,那么正确的方法是什么?