D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15778 - [REG2.064] polysemous string type doesn't work in array operation
Summary: [REG2.064] polysemous string type doesn't work in array operation
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2016-03-08 19:33 UTC by anonymous4
Modified: 2020-03-21 03:56 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description anonymous4 2016-03-08 19:33:11 UTC
void f(wchar[] s)
{
	s[]="a";
}

Error: cannot implicitly convert expression ("a") of type string to wchar[]
Comment 1 ag0aep6g 2016-03-08 21:00:40 UTC
The 'regression' severity level indicates that the code works with a previous version of dmd. What version does it work with?
Comment 2 basile-z 2016-03-09 02:33:33 UTC
void f(wchar[] s)
{
    s[]="a"w;
}

works. 

Obviously in the original example it fails because of the encoding of the literal and the one of the target variable is not the same.

Did it use to work ? (even with IDEone, dmd 2.067, it fails).
Comment 3 Kenji Hara 2016-03-09 15:04:10 UTC
Introduced in 2.064.
Comment 5 github-bugzilla 2016-03-10 10:55:48 UTC
Commits pushed to stable at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/f3849978badaf2e07966c2f6c5c8af50486a1b0a
fix Issue 15778 - polysemous string type doesn't work in array operation

https://github.com/D-Programming-Language/dmd/commit/f1ee0d010a0cdcb7af096f157a18228a9eca0e2f
Merge pull request #5511 from 9rnsr/fix15778

[REG2.064] Issue 15778 - polysemous string type doesn't work in array operation
Comment 6 Temtaime 2016-03-10 14:32:45 UTC
I'm sorry bugzilla redirects in a strange way
Restored status to regression
Comment 7 github-bugzilla 2016-03-14 14:43:25 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/f3849978badaf2e07966c2f6c5c8af50486a1b0a
fix Issue 15778 - polysemous string type doesn't work in array operation

https://github.com/D-Programming-Language/dmd/commit/f1ee0d010a0cdcb7af096f157a18228a9eca0e2f
Merge pull request #5511 from 9rnsr/fix15778
Comment 8 anonymous4 2016-03-14 14:59:16 UTC
(In reply to ag0aep6g from comment #1)
> The 'regression' severity level indicates that the code works with a
> previous version of dmd. What version does it work with?

I upgraded from 2.063 :3