summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/ccgtypes.nim2
-rw-r--r--tests/ccgbugs/tweakopenarray.nim12
2 files changed, 13 insertions, 1 deletions
diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim
index 39f16ff0d..60384be79 100644
--- a/compiler/ccgtypes.nim
+++ b/compiler/ccgtypes.nim
@@ -576,7 +576,7 @@ proc getTypeDescAux(m: BModule, typ: PType, check: var IntSet): Rope =
       result = getTypeDescAux(m, et, check) & star
       idTablePut(m.typeCache, t, result)
   of tyOpenArray, tyVarargs:
-    result = getTypeDescAux(m, t.sons[0], check) & "*"
+    result = getTypeDescWeak(m, t.sons[0], check) & "*"
     idTablePut(m.typeCache, t, result)
   of tyProc:
     result = getTypeName(t)
diff --git a/tests/ccgbugs/tweakopenarray.nim b/tests/ccgbugs/tweakopenarray.nim
new file mode 100644
index 000000000..51d781331
--- /dev/null
+++ b/tests/ccgbugs/tweakopenarray.nim
@@ -0,0 +1,12 @@
+# bug #4089
+
+type
+  Proc = proc(args: openArray[Bar]): Bar
+
+  Foo = object
+    p: Proc
+
+  Bar = object
+    f: Foo
+
+proc bar(val: Foo): Bar = Bar()