Skip to content

Conversation

@jacobly0
Copy link
Member

@jacobly0 jacobly0 commented Aug 5, 2023

What does this code and/or comment mean anyway? All I know is that it doesn't pass the test.

Closes #16601

@xdBronch
Copy link
Contributor

xdBronch commented Aug 5, 2023

is #16688 the same thing?

@mlugg
Copy link
Member

mlugg commented Aug 5, 2023

Also fixed by #16604

[mlugg@polaris test]$ z4 result-type-shenanigans build-obj foo.zig
foo.zig:3:18: error: expected type 'bool', found 'void'
    s.boolMethod({});
                 ^~
foo.zig:12:43: note: parameter type declared here
    fn boolMethod(comptime _: @This(), _: bool) void {}
                                          ^~~~
foo.zig:8:18: error: expected type 'void', found 'bool'
    s.voidMethod(false);
                 ^~~~~
foo.zig:13:43: note: parameter type declared here
    fn voidMethod(comptime _: @This(), _: void) void {}

@andrewrk andrewrk merged commit a91a8df into ziglang:master Aug 5, 2023
@andrewrk
Copy link
Member

andrewrk commented Aug 5, 2023

Looks like leftover from the old implementation that was indeed supposed to be deleted

@mlugg
Copy link
Member

mlugg commented Aug 5, 2023

Looks like leftover from the old implementation that was indeed supposed to be deleted

FWIW my new logic in #16604 retains this and typechecks it fine - presumably the rewrite shuffled around where some type checks happen leading to this issue. (I can remove this functionality from that PR to match this one, it does seem pretty pointless)

@jacobly0 jacobly0 deleted the generic-methods branch August 11, 2023 13:54
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

Successfully merging this pull request may close these issues.

Wrong line position when using non-usize type in allocation

4 participants