From 87f0d534d6da2e8a7dc390e47ba60ca4d8bfb759 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 28 Nov 2019 10:11:25 +0100 Subject: fixes #12488 [backport] --- tests/vm/tmisc_vm.nim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/vm') diff --git a/tests/vm/tmisc_vm.nim b/tests/vm/tmisc_vm.nim index a9a30568d..6eeecb869 100644 --- a/tests/vm/tmisc_vm.nim +++ b/tests/vm/tmisc_vm.nim @@ -15,6 +15,9 @@ Done! foo4 foo4 foo4 +(a: 0, b: 0) +(a: 0, b: 0) +(a: 0, b: 0) ''' """ @@ -234,3 +237,17 @@ static: echo foo() echo foo() echo foo() + +# bug #12488 +type + MyObject = object + a,b: int + MyObjectRef = ref MyObject + +static: + let x1 = new(MyObject) + echo x1[] + let x2 = new(MyObjectRef) + echo x2[] + let x3 = new(ref MyObject) # cannot generate VM code for ref MyObject + echo x3[] -- cgit 1.4.1-2-gfad0