fun setDependencies()

in core/src/main/kotlin/motif/core/State.kt [78:88]


  fun setDependencies(dependencies: Dependencies) {
    val declaredTypes: Set<Type> = dependencies.types.toSet()
    val requiredButNotDeclared: List<Sink> = unsatisfied.filter { !declaredTypes.contains(it.type) }
    requiredButNotDeclared.forEach {
      errors.add(UnsatisfiedDependencyError(dependencies.scope, it))
      unsatisfied.remove(it)
    }

    val visibleButNotDeclared = visibleSinks.keys.filter { !declaredTypes.contains(it.type) }
    visibleButNotDeclared.forEach { visibleSinks.remove(it) }
  }