@motif.Scope
public interface FooScope {
Foo foo();
@motif.Objects
abstract class Objects extends OptionModule {
}
}
class Foo {
private final Bar bar;
public Foo(Bar bar) {
this.bar = bar;
}
}
class Bar {}
abstract class OptionModule {
abstract Bar bar();
Foo foo(Bar bar) {
return new Foo(bar);
}
}
The above code will compile. However, if you add a static key word in OptionModule that is working as Foo factory method, the motif compiler will fail.
abstract class OptionModule {
abstract Bar bar();
static Foo foo(Bar bar) {
return new Foo(bar);
}
}
You could stably reproduce this issue based on this repo.
TonyTangAndroid/motif_static_issue#1