-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
regression(1.2 => 1.4 onwards): Block-local ref types with the same name lead to bad codegen: no member named
#15526
Labels
Comments
timotheecour
changed the title
Block-local ref types with the same name lead to bad codegen
Block-local ref types with the same name lead to bad codegen: Oct 8, 2020
no member named
further info: it's a regression, it used to work in 1.2.0 (through 1.2.8) with ref objectworks in vm, js when true:
# D20201008T141857
template fn() =
block:
type Foo = ref object
x1: int
let f1 = Foo(x1: 1)
echo f1.x1
block:
type Foo = ref object
x2: int
let f2 = Foo(x2: 2)
echo f2.x2
static: fn()
fn() with objectworks in vm, js, RT when defined case5:
template fn() =
block:
type Foo = object
x1: int
let f1 = Foo(x1: 1)
echo f1.x1
block:
type Foo = object
x2: int
let f2 = Foo(x2: 2)
echo f2.x2
static: fn()
fn() |
timotheecour
changed the title
Block-local ref types with the same name lead to bad codegen:
regression(1.2 => 1.4 onwards): Block-local ref types with the same name lead to bad codegen: Feb 24, 2021
no member named
no member named
@timotheecour |
@xflywind indeed, #15526 (comment) was a regression but top example is not a regression, so there's a partial regression here; in any case i'm fixing all these here: #17710 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
basically same as fixed #5170 but for ref types
Example
Current Output
Expected Output
works
Additional Information
basically same as fixed #5170 (which was fixed) but for ref types
The text was updated successfully, but these errors were encountered: