mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
* fix #10053 FieldError for vm * fixup * FieldError now also shows runtime value of discriminant * fix field error reporting in vm * also report culprit line info in err msg * fix errors for newruntime 2 * fix for js * fixup * PRTEMP4 * works * works * works perfect * refactor * std/private/repr_impl * suppport --gc:arc * cleanup * refactor * simplify * simplify * simplify * fixup * move out compiler.vmgen.genCustom * fixup * fixup * add tests * revert compiler/debugutils.nim * simplify reprDiscriminant * fixup * lib/std/private/repr_impl.nim -> lib/system/repr_impl.nim * try to fix D20210812T165220 * honor --declaredlocs * control toFileLineCol via --declaredlocs
31 lines
366 B
Nim
31 lines
366 B
Nim
#[
|
|
ran from trunner
|
|
]#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# line 10
|
|
type Kind = enum k0, k1, k2, k3, k4
|
|
|
|
type Foo = object
|
|
case kind: Kind
|
|
of k0: f0: int
|
|
of k1: f1: int
|
|
of k2: f2: int
|
|
of k3: f3: int
|
|
of k4: f4: int
|
|
|
|
proc main()=
|
|
var foo = Foo(kind: k3, f3: 3)
|
|
let s1 = foo.f3
|
|
doAssert s1 == 3
|
|
let s2 = foo.f2
|
|
|
|
when defined case1:
|
|
static: main()
|
|
when defined case2:
|
|
main()
|