fix #19149 Invalid codegen when returning var tuple from a template (#20762)

* fix #19149 Invalid codegen when returning var tuple from a template

* fix type
This commit is contained in:
Bung 2022-11-06 18:49:34 +08:00 • committed by GitHub
commit bae0fb720a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 2 deletions

19
tests/template/t19149.nim Normal file
View file

@ -0,0 +1,19 @@
type Foo = tuple[active: bool, index: int]
var f: Foo
# template result type during match stage
# f:var Foo
# a:Foo
# tyVar
# tyTuple
# after change to proc
# f:Foo
# a:Foo
# tyTuple
# tyTuple
template cursor(): var Foo = f
discard cursor()