summary refs log tree commit diff stats
path: root/tests/generics/t3770.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/generics/t3770.nim')
-rw-r--r--tests/generics/t3770.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/generics/t3770.nim b/tests/generics/t3770.nim
new file mode 100644
index 000000000..ffccbeeb5
--- /dev/null
+++ b/tests/generics/t3770.nim
@@ -0,0 +1,13 @@
+# bug #3770
+import m3770
+
+doAssert $jjj() == "(hidden: 15)"  # works
+
+proc someGeneric(_: type) =
+  doAssert $jjj() == "(hidden: 15)" # fails: "Error: the field 'hidden' is not accessible."
+
+someGeneric(int)
+
+# bug #20900
+proc c(y: int | int, w: Opt = Opt.none) = discard
+c(0)