-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
nullable type compiler error #1805
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
Comments
|
I don't know where you're getting the idea that this is type recursion, but if you're tripping an assertion then it's a compiler bug. |
The type is recursive. You probably either meant Also, in the code shown |
even when i change |
That sounds like #1500 |
Unless this was cut from other code, |
so should i close this then? |
No, because it's a compiler bug. pub const Node = struct {
children: []?Node,
data: ?u8,
fn new() Node {
return Node{
.children = undefined,
.data = null,
};
}
};
test "aoeu" {
_ = Node.new();
}
|
Proposal to fix this: #2174 |
given the following code:
trying to call
Node.new()
trips this assertioninstead of providing a meaningful error message about how the type is recursive.The text was updated successfully, but these errors were encountered: