Add function to get typed capability from ModuleInfo
This commit is contained in:
@@ -502,4 +502,7 @@ private object DiagnoseUnknownModuleInfoReporter {
|
|||||||
private fun errorInSpecialModuleInfoResolver(message: String): Nothing = throw AssertionError(message)
|
private fun errorInSpecialModuleInfoResolver(message: String): Nothing = throw AssertionError(message)
|
||||||
|
|
||||||
private fun otherError(message: String): Nothing = throw AssertionError(message)
|
private fun otherError(message: String): Nothing = throw AssertionError(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
fun <T> ModuleInfo.getCapability(capability: ModuleDescriptor.Capability<T>) = capabilities[capability] as? T
|
||||||
|
|||||||
Reference in New Issue
Block a user