Reconsider CONFLICTING_PROVIDES_SCOPE diagnostic #1246
-
| 
         We have an use case internally facing the  I created a minimum diagnostic test: // RENDER_DIAGNOSTICS_FULL_TEXT
@DependencyGraph(AppScope::class)
interface AppGraph
interface SyncScope
@DependencyGraph(SyncScope::class)
interface SyncGraph {
  val syncController: SyncController
}
@SingleIn(SyncScope::class)
@Inject
class SyncController
@ContributesTo(AppScope::class)
interface SyncExposedDependenciesModule {
  @SingleIn(AppScope::class)
  @Provides
  fun provideSyncGraph(): SyncGraph {
    return createGraph<SyncGraph>()
  }
  @Provides
  fun <!CONFLICTING_PROVIDES_SCOPE!>provideSyncController<!>(syncGraph: SyncGraph): SyncController = syncGraph.syncController
}
fun box(): String {
  val graph = createGraph<AppGraph>()
  return "OK"
}In the example,  I think this is a valid use case, and would like to either remove this diagnostic or have an option to disable it (if you're open, I can send a PR for that). Let me know if you see it differently, thanks! Reference:  | 
  
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
| 
         That's fair, graphs are special cases since they're not injected on their own. PR welcome to skip this on graphs. Sidenote: not every diagnostic requires an option to disable, kotlin compiler also lets you disable them. That's why I picked a specific name for this one  | 
  
Beta Was this translation helpful? Give feedback.
Actually upon reading at my laptop I'm realizing I misread. I think this is a valid case but this is also why it's a specific warning and I think you should just suppress it as needed