aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-08-16 11:27:29 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-08-16 11:38:41 -0400
commit13c584d325d042879c8c56a3c41ffbf99a3346c0 (patch)
tree8dbe57f0ef8a1da2b9c6db9471a82ebe36aa90aa /src/ir.cpp
parentcba3b8291a18ee16cda2b453bb2bcd4279fa8b98 (diff)
downloadzig-13c584d325d042879c8c56a3c41ffbf99a3346c0.tar.gz
zig-13c584d325d042879c8c56a3c41ffbf99a3346c0.zip
add compile error for casting const frame to anyframe
See #3063
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 9589000ab0..d6fba23856 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -12112,6 +12112,7 @@ static IrInstruction *ir_analyze_cast(IrAnalyze *ira, IrInstruction *source_inst
// *@Frame(func) to anyframe->T or anyframe
if (actual_type->id == ZigTypeIdPointer && actual_type->data.pointer.ptr_len == PtrLenSingle &&
+ !actual_type->data.pointer.is_const &&
actual_type->data.pointer.child_type->id == ZigTypeIdFnFrame && wanted_type->id == ZigTypeIdAnyFrame)
{
bool ok = true;