Cast dependency.constructor to correct type

This commit is contained in:
Tobias Koppers 2018-06-25 16:23:40 +02:00
parent 41343d1763
commit a39c846c78
1 changed files with 2 additions and 5 deletions

View File

@ -915,11 +915,8 @@ class Compilation extends Tapable {
) {
throw new Error("Parameter 'dependency' must be a Dependency");
}
// @ts-ignore
// TODO: Not sure how to handle the
// dependency.constructor error,
// maybe I typed it wrong
const moduleFactory = this.dependencyFactories.get(dependency.constructor);
const Dep = /** @type {DepConstructor} */ (dependency.constructor);
const moduleFactory = this.dependencyFactories.get(Dep);
if (!moduleFactory) {
throw new Error(
`No dependency factory available for this dependency type: ${