IR: rename {name,fqName}Safe -> {name,fqName}ForIrSerialization
These properties have a very specific detail in their behavior, in that the constructor's name is set to be "<init>". While this is OK for the IR serialization, this may not always be expected in other cases, and their rather common names (`name`, `fqNameSafe`) suggested that these properties could be used in generic contexts. Change all usages outside IR serialization to use `IrDeclarationWithName.name` and nullable `IrDeclarationWithName.fqNameWhenAvailable` instead
This commit is contained in:
+1
-1
@@ -79,7 +79,7 @@ class SingleAbstractMethodLowering(val context: CommonBackendContext) : ClassLow
|
||||
// the `irDelegatingConstructorCall` in the constructor below would need to be modified.
|
||||
assert(superClass.kind == ClassKind.INTERFACE) { "SAM conversion to an abstract class not allowed" }
|
||||
|
||||
val superClassName = superClass.fqNameSafe.pathSegments().joinToString("_") { it.toString() }
|
||||
val superClassName = superClass.fqNameWhenAvailable!!.pathSegments().joinToString("_") { it.toString() }
|
||||
val subclass = buildClass {
|
||||
// TODO this is not the name some tests (e.g. kt11519) expect
|
||||
name = Name.identifier("sam\$$superClassName\$${cachedImplementations.size + localImplementations.size}")
|
||||
|
||||
Reference in New Issue
Block a user