mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-23 07:45:23 +00:00
implement semgnrc for tuple and object type nodes (#22709)
fixes #22699
(cherry picked from commit 8836207a4e)
This commit is contained in:
6
tests/generics/mtypenodes.nim
Normal file
6
tests/generics/mtypenodes.nim
Normal file
@@ -0,0 +1,6 @@
|
||||
# issue #22699
|
||||
|
||||
type Private = distinct int
|
||||
|
||||
proc chop*[T](x: int): int =
|
||||
cast[int](cast[tuple[field: Private]](x))
|
||||
@@ -7,7 +7,7 @@ false
|
||||
'''
|
||||
"""
|
||||
|
||||
import mbind_bracket, mclosed_sym, mdotlookup, mmodule_same_as_proc
|
||||
import mbind_bracket, mclosed_sym, mdotlookup, mmodule_same_as_proc, mtypenodes
|
||||
|
||||
|
||||
block tbind_bracket:
|
||||
@@ -57,3 +57,7 @@ block tmodule_same_as_proc:
|
||||
proc test[T](t: T) =
|
||||
mmodule_same_as_proc"a"
|
||||
test(0)
|
||||
|
||||
block ttypenodes:
|
||||
# issue #22699
|
||||
doAssert chop[bool](42) == 42
|
||||
|
||||
Reference in New Issue
Block a user