aboutsummaryrefslogtreecommitdiff
path: root/src/main/stanza/errors.stanza
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/stanza/errors.stanza')
-rw-r--r--src/main/stanza/errors.stanza7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/stanza/errors.stanza b/src/main/stanza/errors.stanza
index fb754406..97660b46 100644
--- a/src/main/stanza/errors.stanza
+++ b/src/main/stanza/errors.stanza
@@ -391,6 +391,10 @@ defn IndexOnNonVector (info:FileInfo) :
PassException $ string-join $
[info ": [module " mname "] Index illegal on non-vector type."]
+defn AccessIndexNotUInt (info:FileInfo) :
+ PassException $ string-join $
+ [info ": [module " mname "] Access index must be a UInt type."]
+
defn IndexNotUInt (info:FileInfo) :
PassException $ string-join $
[info ": [module " mname "] Index is not of UIntType."]
@@ -549,6 +553,9 @@ public defn check-types (c:Circuit) -> Circuit :
match(type(exp(e))) :
(t:VectorType) : false
(t) : add(errors,IndexOnNonVector(info))
+ match(type(index(e))) :
+ (t:UIntType) : false
+ (t) : add(errors,AccessIndexNotUInt(info))
(e:DoPrim) : check-types-primop(e,errors,info)
(e:UIntValue|SIntValue) : false
e