Skip to content

Conversation

So1aric
Copy link

@So1aric So1aric commented Oct 15, 2025

fix #25581.

I found resolveType in zirFunc, I'm not quite sure whether it's the right way but it seems work fine.

@So1aric
Copy link
Author

So1aric commented Oct 15, 2025

Oops I accidently commit the other branch together with this 😢 I'd try to fix this

@So1aric So1aric force-pushed the null_in_return_type branch from 2e9ea32 to 12f4e9b Compare October 15, 2025 14:08
@Vexu
Copy link
Member

Vexu commented Oct 15, 2025

Please add a compiler error test for this.

@So1aric
Copy link
Author

So1aric commented Oct 16, 2025

Added.

@So1aric
Copy link
Author

So1aric commented Oct 16, 2025

I'm stuck at this 😢

========= expected: =====================
:1:15: error: expected type 'type', found '@Typeof(null)'

========= but found: ====================
.zig-cache/o/4905a3d6405f9ad1e1354399b43efe7f/tmp.zig:1:15: error: expected type 'type', found '@TypeOf(null)'

How to eliminate the file src loc? 😔

@mlugg
Copy link
Member

mlugg commented Oct 16, 2025

The problem isn't the file src loc; while it shows it in the "but found" part, it'll actually match fine without it. The problem is the capitalization of @TypeOf in the message (you've written @Typeof with a lowercase "o").

@So1aric So1aric force-pushed the null_in_return_type branch from 1d01a18 to e369aa8 Compare October 16, 2025 11:28
@So1aric So1aric force-pushed the null_in_return_type branch from e369aa8 to bd77e43 Compare October 16, 2025 11:29
@So1aric
Copy link
Author

So1aric commented Oct 16, 2025

The problem isn't the file src loc; while it shows it in the "but found" part, it'll actually match fine without it. The problem is the capitalization of @TypeOf in the message (you've written @Typeof with a lowercase "o").

Thanks!

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.

null as a return type of an inline fn crashes the compiler

3 participants