summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/condsyms.nim1
-rw-r--r--compiler/semdata.nim11
2 files changed, 11 insertions, 1 deletions
diff --git a/compiler/condsyms.nim b/compiler/condsyms.nim
index bcd9592e6..342bc520b 100644
--- a/compiler/condsyms.nim
+++ b/compiler/condsyms.nim
@@ -99,3 +99,4 @@ proc initDefines*() =
   defineSymbol("nimKnowsNimvm")
   defineSymbol("nimArrIdx")
   defineSymbol("nimImmediateDeprecated")
+  defineSymbol("nimNewShiftOps")
diff --git a/compiler/semdata.nim b/compiler/semdata.nim
index 2fec8c757..641dc3304 100644
--- a/compiler/semdata.nim
+++ b/compiler/semdata.nim
@@ -243,7 +243,16 @@ proc makeAndType*(c: PContext, t1, t2: PType): PType =
 
 proc makeOrType*(c: PContext, t1, t2: PType): PType =
   result = newTypeS(tyOr, c)
-  result.sons = @[t1, t2]
+  if t1.kind != tyOr and t2.kind != tyOr:
+    result.sons = @[t1, t2]
+  else:
+    template addOr(t1) =
+      if t1.kind == tyOr:
+        for x in t1.sons: result.rawAddSon x
+      else:
+        result.rawAddSon t1
+    addOr(t1)
+    addOr(t2)
   propagateToOwner(result, t1)
   propagateToOwner(result, t2)
   result.flags.incl((t1.flags + t2.flags) * {tfHasStatic})