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

incorrect type hints for tuples #2065

Open
JonathanHallstrom opened this issue Oct 26, 2024 · 0 comments
Open

incorrect type hints for tuples #2065

JonathanHallstrom opened this issue Oct 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@JonathanHallstrom
Copy link

JonathanHallstrom commented Oct 26, 2024

Zig Version

0.13.0

ZLS Version

0.13.0

Client / Code Editor / Extensions

vscode with zls and wsl

Steps to Reproduce and Observed Behavior

create a file containing:

pub fn main() !void {
    var a: f32 = 0;
    var b: i64 = 1;
    const tmp = .{b, a};

    _ = &a;
    _ = &b;
    _ = &tmp;
}

gives the wrong type hint:
image

Expected Behavior

correct type hint, struct{i64,f32}

Relevant log output

No response

@JonathanHallstrom JonathanHallstrom added the bug Something isn't working label Oct 26, 2024
Techatrix added a commit that referenced this issue Nov 7, 2024
- resolve destructured variable declarations according to the initialization expression
- semantic tokens will highlight destructured variable declarations
- don't treat tuple literals as array literals (see #2065)
Techatrix added a commit that referenced this issue Nov 7, 2024
- resolve destructured variable declarations according to the initialization expression
- semantic tokens will highlight destructured variable declarations
- don't treat tuple literals as array literals (see #2065)
Techatrix added a commit that referenced this issue Nov 7, 2024
- resolve destructured variable declarations according to the initialization expression
- semantic tokens will highlight destructured variable declarations
- don't treat tuple literals as array literals (see #2065)
Techatrix added a commit that referenced this issue Nov 12, 2024
- resolve destructured variable declarations according to the initialization expression
- semantic tokens will highlight destructured variable declarations
- don't treat tuple literals as array literals (see #2065)
@Techatrix Techatrix changed the title incorrect type hint incorrect type hints for tuples Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant