new tester; all tests categorized
This commit is contained in:
parent
51ee524109
commit
20b5f31c03
481 changed files with 794 additions and 2506 deletions
23
tests/objvariant/tadrdisc.nim
Normal file
23
tests/objvariant/tadrdisc.nim
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
discard """
|
||||
file: "tadrdisc.nim"
|
||||
line: 20
|
||||
errormsg: "for a \'var\' type a variable needs to be passed"
|
||||
"""
|
||||
# Test that the address of a dicriminants cannot be taken
|
||||
|
||||
type
|
||||
TKind = enum ka, kb, kc
|
||||
TA = object
|
||||
case k: TKind
|
||||
of ka: x, y: int
|
||||
of kb: a, b: string
|
||||
of kc: c, d: float
|
||||
|
||||
proc setKind(k: var TKind) =
|
||||
k = kc
|
||||
|
||||
var a: TA
|
||||
setKind(a.k) #ERROR_MSG for a 'var' type a variable needs to be passed
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue