summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2018-04-22 18:11:22 +0300
committerZahary Karadjov <zahary@gmail.com>2018-06-16 16:46:32 +0300
commitab9969ed3be2d57fdeda170cc9960be7ba628149 (patch)
tree9b36a31c68842e4c2ca835aec1085aa3adfafebc /compiler
parent509d6e923284f1f02c5dbc64e43aee9df1a012d3 (diff)
downloadNim-ab9969ed3be2d57fdeda170cc9960be7ba628149.tar.gz
Bugfix: the size of an array may be a static tuple element
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semtypes.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index 19bb53209..6b27c8032 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -301,7 +301,8 @@ proc semArrayIndex(c: PContext, n: PNode): PType =
         localError(c.config, info, errOrdinalTypeExpected)
       result = makeRangeWithStaticExpr(c, e)
       if c.inGenericContext > 0: result.flags.incl tfUnresolved
-    elif e.kind in nkCallKinds and hasGenericArguments(e):
+    elif e.kind in (nkCallKinds + {nkBracketExpr}) and
+         hasGenericArguments(e):
       if not isOrdinalType(e.typ):
         localError(c.config, n[1].info, errOrdinalTypeExpected)
       # This is an int returning call, depending on an