[Issue 12167] GIT HEAD: AAs are broken
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Feb 16 06:12:52 PST 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12167
--- Comment #8 from yebblies <yebblies at gmail.com> 2014-02-17 01:12:50 EST ---
(In reply to comment #0)
> immutable int[int] table;
>
> static this() {
> table = [ 1: 2 ];
> table.rehash;
> }
>
> src\druntime\import\object.di(382): Error: cannot implicitly convert expression
> (aa) of type immutable(int[int]) to immutable(int)[int]
>
> Error: template instance object.rehash!(immutable(int[int]), immutable(int),
> int) error instantiating
>
Wait, wtf, why are you rehashing an immutable AA? That obviously doesn't work,
it's immutable. Looks like it was previously accepting invalid code.
(In reply to comment #7)
> This is one another regression caused by removing object.AssociativeArray.
>
> struct S11 { int opCmp(T : typeof(this))(T) { return 0; } }
> void main()
> {
> { auto ti = typeid(int[S11]); }
> }
>
> This code compiles used to compile until 2.064, but in 2.065 development term,
> it has been made disallowed by the fix for issue 11591.
>
> But in git head, it does not cause error. I noticed the change during maintain
> 2.065 branch (Related PR:
> https://github.com/D-Programming-Language/dmd/pull/3271).
For me it gives:
DMD v2.065 DEBUG
testx.d(4): Error: associative array key type S11 does not have 'const int
opCmp(ref const S11)' member function
With git head.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list