Skip to content

Commit

Permalink
Fix klib metadata (#89)
Browse files Browse the repository at this point in the history
Closes: #87

Co-authored-by: Jesse Wilson <[email protected]>
  • Loading branch information
swankjesse and squarejesse authored Jan 23, 2025
1 parent 628f6cf commit 48481d4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ class BurstGradlePluginTest {
)
val klibMetadata = klib.moduleMetadata()
val coffeeTestMetadata = klibMetadata.classes.first { it.name == "CoffeeTest" }
// TODO: This expected output is wrong. It should have specializations like test_Milk etc.
// https://github.com/cashapp/burst/issues/87
assertThat(coffeeTestMetadata.functions.map { it.name }).containsExactlyInAnyOrder(
"setUp",
"test",
"test_Milk",
"test_None",
"test_Oat",
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ internal class ClassSpecializer(
superConstructor: IrConstructor,
specialization: Specialization,
) {
original.addConstructor {
val constructor = original.addConstructor {
initDefaults(original)
isPrimary = false
}.apply {
Expand All @@ -178,5 +178,6 @@ internal class ClassSpecializer(
}
}
}
pluginContext.metadataDeclarationRegistrar.registerConstructorAsMetadataVisible(constructor)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ internal class FunctionSpecializer(
// Add new declarations.
for (function in functions) {
originalParent.addDeclaration(function)
pluginContext.metadataDeclarationRegistrar.registerFunctionAsMetadataVisible(function)
}
}

Expand Down

0 comments on commit 48481d4

Please sign in to comment.