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

Block-local ref types with the same name lead to bad codegen #15527

Closed
timotheecour opened this issue Oct 8, 2020 · 1 comment
Closed

Block-local ref types with the same name lead to bad codegen #15527

timotheecour opened this issue Oct 8, 2020 · 1 comment

Comments

@timotheecour
Copy link
Member

basically same as fixed #5170 but for ref types

Example

when true: # D20201008T141857
  block:
    type Foo = ref object
      x1: int
    let f1 = Foo(x1: 1)
  block:
    type Foo = ref object
      x2: int
    let f2 = Foo(x2: 2)

Current Output

@mt11116.nim.c:422:10: error: no member named 'x2' in 'struct tyObject_FoocolonObjectType___ktEbVfDBqcSUCx9b6syN8LA'
                (*T4_).x2 = ((NI) 2);

Expected Output

works

Additional Information

basically same as fixed #5170 (which was fixed) but for ref types

  • nim devel 1.3.7 3eaacac and prior
@timotheecour
Copy link
Member Author

github glitch, it opened a duplicate identical issue to #15526

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