-
-
Notifications
You must be signed in to change notification settings - Fork 706
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
Fixed issue 14981 #3678
Fixed issue 14981 #3678
Conversation
| @@ -7250,7 +7250,7 @@ if (isInputRange!Range) | |||
| } | |||
|
|
|||
| // Assertion only. | |||
| private void dbgVerifySorted() | |||
| private auto dbgVerifySorted() | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this work? I copied the code and the deduced return type remained void.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type is inferred as void. It should probably be turned into a template function instead.
private void dbgVerifySorted()()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't get how this fixes the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@atilaneves In 2.068, auto functions function attributes are inferred http://dlang.org/changelog/2.068.0.html#attribinference3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought member functions of template structs/classes were already inferred?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might be right, I don't know. I thought that they were only inferred if they were templates or auto functions themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this compiles. There is another reason why this isn't working. I agree with @atilaneves.
struct S(T)
{
void foo() {}
}
void main() nothrow
{
S!int s;
s.foo();
}|
Changing the return type back to |
|
2.067.1 does not fail, 2.068.0 does, and the head revision does not fail. So this was a regression, and seems to have been fixed. |
Yes, I think that was it. Because prior to that, there was a call to uniform, which calls enforce, which can throw. |
|
Hm.. interestingly, the code hadn't changed since 2.067.1 to 2.068.0, but did not fail in the prior version. Weird. So many different players here, perhaps it was a change in Array? In any case, all is well now. |
Using the new
autofunction attribute inference in 2.068.https://issues.dlang.org/show_bug.cgi?id=14981