new tester; all tests categorized
This commit is contained in:
parent
51ee524109
commit
20b5f31c03
481 changed files with 794 additions and 2506 deletions
26
tests/generics/tgenericrefs.nim
Normal file
26
tests/generics/tgenericrefs.nim
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
type
|
||||
PA[T] = ref TA[T]
|
||||
TA[T] = object
|
||||
field: T
|
||||
var a: PA[string]
|
||||
new(a)
|
||||
a.field = "some string"
|
||||
|
||||
when false:
|
||||
# Compiles unless you use var a: PA[string]
|
||||
type
|
||||
PA = ref TA
|
||||
TA[T] = object
|
||||
|
||||
|
||||
# Cannot instantiate:
|
||||
type
|
||||
TA[T] = object
|
||||
a: PA[T]
|
||||
PA[T] = ref TA[T]
|
||||
|
||||
type
|
||||
PA[T] = ref TA[T]
|
||||
TA[T] = object
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue