summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semexprs.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 2efa1259a..8ac8f4750 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -319,6 +319,8 @@ proc semConv(c: PContext, n: PNode; expectedType: PType = nil): PNode =
       return evaluated
     else:
       targetType = targetType.base
+  of tyAnything, tyUntyped, tyTyped:
+    localError(c.config, n.info, "illegal type conversion to '$1'" % typeToString(targetType))
   else: discard
 
   maybeLiftType(targetType, c, n[0].info)