Minor, extract isInstanceType to protoTypeTableUtil

This commit is contained in:
Alexander Udalov
2018-03-16 23:21:45 +01:00
parent f7a3182982
commit 13df75ef74
2 changed files with 8 additions and 7 deletions
@@ -101,3 +101,9 @@ fun ProtoBuf.TypeAlias.expandedType(typeTable: TypeTable): ProtoBuf.Type = when
hasExpandedTypeId() -> typeTable[expandedTypeId]
else -> error("No expandedType in ProtoBuf.TypeAlias")
}
fun ProtoBuf.Expression.isInstanceType(typeTable: TypeTable): ProtoBuf.Type? = when {
hasIsInstanceType() -> isInstanceType
hasIsInstanceTypeId() -> typeTable[isInstanceTypeId]
else -> null
}