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

let-bindings don't work with impl methods #1895

Open
grebe opened this issue Jan 29, 2025 · 0 comments
Open

let-bindings don't work with impl methods #1895

grebe opened this issue Jan 29, 2025 · 0 comments
Labels
dslx DSLX (domain specific language) implementation / front-end 🧦 sox

Comments

@grebe
Copy link
Collaborator

grebe commented Jan 29, 2025

Consider the following:

pub struct A { x: u32 }
pub impl A {
    pub fn dump(self: Self) -> u32 { self.x }
}

pub fn main(a: A) -> u32 {
    let to_dump = a.dump();
    to_dump
}

This should typecheck, and it does if main instead directly returns a.dump() instead of binding to an intermediate. However, running interpreter_main gives a BytecodeEmitter could not find slot or binding for name error.

@grebe grebe added dslx DSLX (domain specific language) implementation / front-end 🧦 sox labels Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dslx DSLX (domain specific language) implementation / front-end 🧦 sox
Projects
Status: No status
Development

No branches or pull requests

1 participant