Convert type-parameter-out-of-scope warning into consistency query

The warning in the extractor is inaccurate due to references to enclosing types' type parameters. A consistency query can check that the type parameter is indeed in scope exploiting broader knowledge of the enclosing types.
This commit is contained in:
Chris Smowton
2022-02-09 18:58:17 +00:00
committed by Ian Lynagh
parent 36356c2937
commit 7fe260c1a2
2 changed files with 40 additions and 5 deletions

View File

@@ -863,11 +863,7 @@ open class KotlinUsesExtractor(
fun useTypeParameter(param: IrTypeParameter) =
TypeResult(
tw.getLabelFor<DbTypevariable>(getTypeParameterLabel(param)) {
// Any type parameter that is in scope should have been extracted already
// in extractClassSource or extractFunction
logger.error("Missing type parameter label")
},
tw.getLabelFor<DbTypevariable>(getTypeParameterLabel(param)),
useType(eraseTypeParameter(param)).javaResult.signature,
param.name.asString()
)