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

Assert in c code generator #5389

Closed
vegansk opened this issue Feb 14, 2017 · 3 comments
Closed

Assert in c code generator #5389

vegansk opened this issue Feb 14, 2017 · 3 comments

Comments

@vegansk
Copy link
Contributor

vegansk commented Feb 14, 2017

Minimal example:

import future, sequtils

type
  Validation[A] = object
  Validator[X, A] = X -> Validation[A]

proc mkValidator[A](
  msg: string,
  predicate:  A -> bool
): Validator[A, A] =
  var a: A
  let b = a

block:
  type
    Y = object
      yVal: string
      zObj: Z
    Z = object
      zVal: bool

  let
    valY = mkValidator("yVal is empty", (y: Y) => y.yVal.len > 0)

block:
  type
    Y = object
      yVal: string
      zObj: Z
    Z = object
      zVal: bool

  let
    valY = mkValidator("yVal is empty", (y: Y) => y.yVal.len > 0)

fails on that assert: https://github.com/nim-lang/Nim/blob/devel/compiler/ccgexprs.nim#L201

@vegansk
Copy link
Contributor Author

vegansk commented Feb 14, 2017

Duplicate of #5170

@vegansk vegansk closed this as completed Feb 14, 2017
@vegansk
Copy link
Contributor Author

vegansk commented Feb 14, 2017

No, #5170 doesn't fail on that assert

@vegansk vegansk reopened this Feb 14, 2017
@vegansk
Copy link
Contributor Author

vegansk commented Feb 16, 2017

Fixed in 6499462

@vegansk vegansk closed this as completed Feb 16, 2017
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