mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
21 lines
344 B
Nim
21 lines
344 B
Nim
discard """
|
|
file: "tadrdisc.nim"
|
|
line: 20
|
|
errormsg: "type mismatch: got (TKind)"
|
|
"""
|
|
# 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)
|