From 3550c907decd206d74c8b5fc3008a8b731491bbe Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Mon, 5 Feb 2024 22:46:51 +0800 Subject: [PATCH] closes #14710; adds a test case (#23277) closes #14710 --- tests/types/tissues_types.nim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/types/tissues_types.nim b/tests/types/tissues_types.nim index eab4e8e9be..49c6d85eea 100644 --- a/tests/types/tissues_types.nim +++ b/tests/types/tissues_types.nim @@ -96,3 +96,13 @@ block: # issue #12582 x: foo(int) # error let b = Bar() let b2 = Bar(x: [123]) + +block: + when true: # bug #14710 + type Foo[T] = object + x1: int + when T.sizeof == 4: discard # SIGSEGV + when sizeof(T) == 4: discard # ok + let t = Foo[float](x1: 1) + doAssert t.x1 == 1 +