IR tests: check IrSimpleFunction.isFakeOverride
This commit is contained in:
@@ -70,7 +70,8 @@ abstract class AbstractIrTextTestCase : AbstractIrGeneratorTestCase() {
|
|||||||
|
|
||||||
val path = wholeFile.path
|
val path = wholeFile.path
|
||||||
val replacedPath = path.replace(".kt", "__")
|
val replacedPath = path.replace(".kt", "__")
|
||||||
val externalFilePaths = wholeFile.parentFile.listFiles().mapNotNullTo(mutableListOf()) {
|
val filesInDir = wholeFile.parentFile.listFiles() ?: return
|
||||||
|
val externalFilePaths = filesInDir.mapNotNullTo(mutableListOf()) {
|
||||||
if (it.path.startsWith(replacedPath)) it.path else null
|
if (it.path.startsWith(replacedPath)) it.path else null
|
||||||
}
|
}
|
||||||
for (externalClassFqn in parseDumpExternalClasses(wholeText)) {
|
for (externalClassFqn in parseDumpExternalClasses(wholeText)) {
|
||||||
@@ -232,6 +233,14 @@ abstract class AbstractIrTextTestCase : AbstractIrGeneratorTestCase() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun visitSimpleFunction(declaration: IrSimpleFunction) {
|
||||||
|
visitFunction(declaration)
|
||||||
|
|
||||||
|
require((declaration.origin == IrDeclarationOrigin.FAKE_OVERRIDE) == declaration.isFakeOverride) {
|
||||||
|
"${declaration.descriptor}: origin: ${declaration.origin}; isFakeOverride: ${declaration.isFakeOverride}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun visitDeclarationReference(expression: IrDeclarationReference) {
|
override fun visitDeclarationReference(expression: IrDeclarationReference) {
|
||||||
expression.symbol.checkBinding("ref", expression)
|
expression.symbol.checkBinding("ref", expression)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user