summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semtypes.nim7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index e24ecdbdf..6a2783551 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -610,9 +610,10 @@ proc semRecordCase(c: PContext, n: PNode, check: var IntSet, pos: var int,
     chckCovered = true
   of tyFloat..tyFloat128, tyString, tyError:
     discard
-  else:
-    if not isOrdinalType(typ):
-      localError(c.config, n.info, "selector must be of an ordinal type, float or string")
+  of tyForward:
+    errorUndeclaredIdentifier(c, n.sons[0].info, typ.sym.name.s)
+  elif not isOrdinalType(typ):
+    localError(c.config, n.sons[0].info, "selector must be of an ordinal type, float or string")
   for i in 1 ..< sonsLen(n):
     var b = copyTree(n.sons[i])
     addSon(a, b)