new tester; all tests categorized
This commit is contained in:
parent
51ee524109
commit
20b5f31c03
481 changed files with 794 additions and 2506 deletions
20
tests/typerel/tcommontype.nim
Normal file
20
tests/typerel/tcommontype.nim
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
type
|
||||
TAnimal=object {.inheritable.}
|
||||
PAnimal=ref TAnimal
|
||||
|
||||
TDog=object of TAnimal
|
||||
PDog=ref TDog
|
||||
|
||||
TCat=object of TAnimal
|
||||
PCat=ref TCat
|
||||
|
||||
TAnimalArray=array[0..2,PAnimal]
|
||||
|
||||
proc newDog():PDog = new(result)
|
||||
proc newCat():PCat = new(result)
|
||||
proc test(a:openarray[PAnimal])=
|
||||
echo("dummy")
|
||||
|
||||
#test(newDog(),newCat()) #does not work
|
||||
var myarray:TAnimalArray=[newDog(),newCat(),newDog()] #does not work
|
||||
#var myarray2:TAnimalArray=[newDog(),newDog(),newDog()] #does not work either
|
||||
Loading…
Add table
Add a link
Reference in a new issue