summaryrefslogtreecommitdiff
path: root/source/slang/ir.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/ir.h')
-rw-r--r--source/slang/ir.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/slang/ir.h b/source/slang/ir.h
index e62bb2249..343f5b79b 100644
--- a/source/slang/ir.h
+++ b/source/slang/ir.h
@@ -952,7 +952,15 @@ struct IRStructKey : IRInst
struct IRStructField : IRInst
{
IRStructKey* getKey() { return cast<IRStructKey>(getOperand(0)); }
- IRType* getFieldType() { return cast<IRType>(getOperand(1)); }
+ IRType* getFieldType()
+ {
+ // Note: We do not use `cast` here because there are
+ // cases of types (which we would like to conveniently
+ // refer to via an `IRType*`) which do not actually
+ // inherit from `IRType` in the hierarchy.
+ //
+ return (IRType*) getOperand(1);
+ }
IR_LEAF_ISA(StructField)
};