Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RT vs CT: intVal nim VM bug #92

Closed
timotheecour opened this issue Nov 14, 2020 · 1 comment
Closed

RT vs CT: intVal nim VM bug #92

timotheecour opened this issue Nov 14, 2020 · 1 comment

Comments

@timotheecour
Copy link
Contributor

timotheecour commented Nov 14, 2020

(with nim-lang/Nim#15947)

example 1: works at RT, nim bug at CT

when defined case5f:
  #[
  Error: unhandled exception: 'intVal' is not accessible using discriminant 'kind' of type 'TFullReg' [FieldDefect]
  ]#
  import yaml
  type
    Node = ref object
      name1: string
      lhs: Node
      rhs: Node
  proc main =
    let input = """
{
  name1: A,
  lhs: &ref1 {
    name1: B,
    lhs: *ref1,
    rhs: ~
  },
  rhs: *ref1
}
"""
    var root = loadAs[Node](input)
    echo root.name1
    echo root.lhs.name1
    echo root.rhs.lhs.lhs.name1
  static: main()
  main()
timotheecour added a commit to timotheecour/Nim that referenced this issue Nov 14, 2020
@timotheecour
Copy link
Contributor Author

timotheecour commented Nov 14, 2020

@flyx
after the last commit in nim-lang/Nim#15947

https://github.com/nim-lang/Nim/pull/15947/commits/4975608ae8d89fb065c59608d49b4c95eaa33d46 fix in opcCastIntToPtr (fixes flyx/NimYAML#92)

this now works, showing nimyaml anchors do work in CT:

this prints:
A
B
B

at both RT and CT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant