From 425972c4e8bde84ff8b84a64f1e68356dc0a1a3a Mon Sep 17 00:00:00 2001 From: Clyybber Date: Fri, 10 Jul 2020 19:21:50 +0200 Subject: [PATCH] Add testcase for some old fixed issues (#14960) * Add testcase for #2703 * Add testcase for #2586 * Small fix --- tests/template/template_issues.nim | 8 ++++++++ tests/ccgbugs/trecursive_closure.nim => tissues.nim | 10 ++++++++++ 2 files changed, 18 insertions(+) rename tests/ccgbugs/trecursive_closure.nim => tissues.nim (67%) diff --git a/tests/template/template_issues.nim b/tests/template/template_issues.nim index 420373e618..d12b3c3ef4 100644 --- a/tests/template/template_issues.nim +++ b/tests/template/template_issues.nim @@ -11,6 +11,8 @@ hey foo foo foo +false +true ''' """ @@ -266,3 +268,9 @@ iterator hello() : int {.closure.} = foof(int) ggg(hello) + + +# bug #2586 +var z = 10'u8 +echo z < 9 # Works +echo z > 9 # Error: type mismatch diff --git a/tests/ccgbugs/trecursive_closure.nim b/tissues.nim similarity index 67% rename from tests/ccgbugs/trecursive_closure.nim rename to tissues.nim index 4b6514b906..7a8ede9589 100644 --- a/tests/ccgbugs/trecursive_closure.nim +++ b/tissues.nim @@ -16,3 +16,13 @@ f(nil) type A = object #of RootObj <-- Uncomment this to get no errors test: proc(i: A): bool var a: proc(i: A): bool # Or comment this line to get no errors + + +# bug #2703 +type + fooObj[T] = object of RootObj + bazObj[T] = object of fooObj[T] + x: T + +var troz: fooObj[string] +echo bazObj[string](troz).x