evant / kotlin-inject

Dependency injection lib for kotlin
Apache License 2.0
1.29k stars 60 forks source link

Resolving type arguments may throw an exception for star projections #412

Open vRallev opened 4 months ago

vRallev commented 4 months ago

Following code exists as is today in KSAstType:

    override val arguments: List<AstType>
        get() = type.arguments.map {
            val argumentType = checkNotNull(it.type) {
                "Couldn't resolve type for $it with variance ${it.variance} from parent type $type"
            }
            KSAstType(resolver, argumentType)
        }

This may crash, if the type is null and this happens in some cases for star projections as highlighted in #411. This exception is caught only when checking for wrongly placed qualifiers for now.