Support exhaustive when

This commit is contained in:
Michael Bogdanov
2016-09-30 14:41:52 +03:00
committed by Dmitry Petrov
parent a0d9d24c1f
commit 0b45655b7b
5 changed files with 63 additions and 3 deletions
@@ -82,6 +82,19 @@ class IrBuiltIns(val builtIns: KotlinBuiltIns) {
initialize(null, null, listOf(typeParameterT), listOf(valueParameterName), returnType, Modality.FINAL, Visibilities.PUBLIC)
}
val noWhenBranchMatchedException: FunctionDescriptor =
SimpleFunctionDescriptorImpl.create(
packageFragment,
Annotations.EMPTY,
Name.identifier("noWhenBranchMatchedException"),
CallableMemberDescriptor.Kind.SYNTHESIZED,
org.jetbrains.kotlin.descriptors.SourceElement.NO_SOURCE
).apply {
val returnType = KotlinTypeFactory.simpleType(Annotations.EMPTY, builtIns.unit.typeConstructor, listOf(), false)
initialize(null, null, listOf(), listOf(), returnType, Modality.FINAL, Visibilities.PUBLIC)
}
companion object {
val KOTLIN_INTERNAL_IR_FQN = FqName("kotlin.internal.ir")
}