Abnaxos / meldioc

A prototype of an IoC (Inversion of Control) library for Java
MIT License
5 stars 1 forks source link

Add a compiler warning on default implementations in provisions of interfaces #109

Open Abnaxos opened 2 years ago

Abnaxos commented 2 years ago

It may seem like a good idea to provide defaults in the feature interface for common use cases, the library used to do this in several instances, e.g.

@Feature
interface ForkJoinPoolFeature {
  @Provision
  ForkJoinPool forkJoinPool() {
    return ForkJoinPool.commonPool();
  }
}

However, since 0.2 doesn't allow overriding provisions in configurations any more (#104), doing this will cause conflicts. Doing this is basically asking for unresolvable conflicts. Don't do this.

Add a warning to the processor.