Skip to content
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

Vector ops with different types #18585

Open
dlangBugzillaToGithub opened this issue May 23, 2013 · 3 comments
Open

Vector ops with different types #18585

dlangBugzillaToGithub opened this issue May 23, 2013 · 3 comments

Comments

@dlangBugzillaToGithub
Copy link

bearophile_hugs reported this on 2013-05-23T15:34:00Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=10157

CC List

Description

Is code like this meant to work? It's useful code:


void main() {
    int[2] data = [10, 20];
    double[2] result;
    result[] = data[] * 0.5;
}



DMD 2.063beta5 gives:

test.d(4): Error: incompatible types for ((data[]) * (0.5)): 'int[]' and 'double'
@dlangBugzillaToGithub
Copy link
Author

code (@MartinNowak) commented on 2017-08-17T11:37:37Z

https://github.com/dlang/dmd/pull/4218

@dlangBugzillaToGithub
Copy link
Author

dfj1esp02 commented on 2017-08-21T13:59:15Z

void f()
{
	ubyte[] a;
	char[] b;
	a[]=b[];
}
Error: cannot implicitly convert expression `b[]` of type `char[]` to `ubyte[]`

@dlangBugzillaToGithub
Copy link
Author

dfj1esp02 commented on 2017-08-21T14:00:16Z

Hmm... vector ops are array ops?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant