diff options
author | Clyybber <darkmine956@gmail.com> | 2020-07-10 17:13:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-10 17:13:37 +0200 |
commit | 0db32e98854dd3fc5a6e1d27a1d4980fd61053da (patch) | |
tree | dbad952597c008d5e6f0afaed36ce54dab231b61 /tests | |
parent | b21782a667f7a819124e95da14053387bd0079a0 (diff) | |
download | Nim-0db32e98854dd3fc5a6e1d27a1d4980fd61053da.tar.gz |
Add testcase for #12571 (#14955)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/statictypes/tstatictypes.nim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/statictypes/tstatictypes.nim b/tests/statictypes/tstatictypes.nim index 2a8d09dbf..50dc60e09 100644 --- a/tests/statictypes/tstatictypes.nim +++ b/tests/statictypes/tstatictypes.nim @@ -9,6 +9,7 @@ output: ''' b is 2 times a 17 ['\x00', '\x00', '\x00', '\x00'] +heyho ''' """ @@ -223,3 +224,18 @@ block: # issue #14802 12 const myConst = static(fn(1)) doAssert myConst == 12 + + +# bug #12571 +type + T[K: static bool] = object of RootObj + when K == true: + foo: string + else: + bar: string + U[K: static bool] = object of T[K] + +let t = T[true](foo: "hey") +let u = U[false](bar: "ho") +echo t.foo, u.bar + |