-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
Refused fixed size array literal function argument #18829
Labels
Comments
yebblies commented on 2014-05-17T07:56:39ZThat's not an array literal, that's either an array initializer or an associative array literal, depending on context. You can't use an array initializer except when initializing a variable. |
bearophile_hugs commented on 2014-05-17T08:14:04Z(In reply to yebblies from comment #1)
> That's not an array literal, that's either an array initializer or an
> associative array literal, depending on context. You can't use an array
> initializer except when initializing a variable.
I see. So is this request INVALID and to be closed? |
yebblies commented on 2014-05-17T08:25:58Z(In reply to bearophile_hugs from comment #2)
> (In reply to yebblies from comment #1)
> > That's not an array literal, that's either an array initializer or an
> > associative array literal, depending on context. You can't use an array
> > initializer except when initializing a variable.
>
> I see. So is this request INVALID and to be closed?
Either that or turn it into an enhancement to allow array initializers to be used in any array-accepting context instead of just assignment. |
yebblies commented on 2014-05-17T08:27:41ZIf this was implemented, this call would become ambiguous.
void foo(int[1]) {}
void foo(int[int]) {}
void main()
{
foo([0 : 1]);
} |
bearophile_hugs commented on 2014-05-18T08:39:52Z(In reply to yebblies from comment #4)
> If this was implemented, this call would become ambiguous.
>
> void foo(int[1]) {}
> void foo(int[int]) {}
>
> void main()
> {
> foo([0 : 1]);
> }
Right. And adding more ambiguous code to D is not a good idea.
Walter doesn't seem in a rush to find a fix for my Issue 4703 that is almost four years old. If some kind of fix for issue 4703 is ever found and accepted, then this enhancement request becomes acceptable.
So I tag this as enhancement request that depends on Issue 4703 . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
bearophile_hugs reported this on 2014-05-16T19:20:17Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=12757
CC List
Description
The text was updated successfully, but these errors were encountered: