Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Mar 3, 2014

@yebblies
Copy link
Contributor

yebblies commented Mar 3, 2014

Because this is a template, can you get rid of inout completely? Or, does defaultValue need to be inout too?

@9rnsr
Copy link
Contributor Author

9rnsr commented Mar 3, 2014

Using inout will reduce the number of instantiations of get function template. And yes, we should also need to be defaultValue inout.

Updated.

@yebblies
Copy link
Contributor

yebblies commented Mar 3, 2014

Doesn't work with ctfe. Compiler bug?

@9rnsr
Copy link
Contributor Author

9rnsr commented Mar 3, 2014

Gaaa, test/runnable/testaa3.d is broken by a new CTFE bug. I'll see it tomorrow.

@9rnsr
Copy link
Contributor Author

9rnsr commented Mar 3, 2014

@yebblies Yes, it's definitely a compiler bug and it's unrelated to AA implementations.

The error message in testaa3.d is:

test\runnable\testaa3.d(198): Error: reinterpreting cast from immutable(int[int])* to const(int[int])* is not supported in CTFE
test\runnable\testaa3.d(198):        called from here: get(cast(const(int[int])*)aa, 1, delegate inout(int)() => 2)
test\runnable\testaa3.d(293):        called from here: testPointerImmutable()
test\runnable\testaa3.d(293):        while evaluating: static assert(testPointerImmutable())

But the conversion from immutable(int[int])* to const(int[int])* is not a reinterpret cast.

@9rnsr
Copy link
Contributor Author

9rnsr commented Mar 4, 2014

OK, I have found the cause.

https://d.puremagic.com/issues/show_bug.cgi?id=12296
dlang/dmd#3355

@9rnsr
Copy link
Contributor Author

9rnsr commented Mar 4, 2014

Ready to merge.

@yebblies
Copy link
Contributor

yebblies commented Mar 4, 2014

Auto-merge toggled on

yebblies added a commit that referenced this pull request Mar 4, 2014
[REG2.066a] Issue 12220 - hash.get() does not accept proper parameters
@yebblies yebblies merged commit 7c8722f into dlang:master Mar 4, 2014
@9rnsr
Copy link
Contributor Author

9rnsr commented Mar 4, 2014

Thanks!

@9rnsr 9rnsr deleted the fix12220 branch March 4, 2014 06:05
@CyberShadow
Copy link
Member

This pull request introduced a regression:
https://d.puremagic.com/issues/show_bug.cgi?id=12316

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

Successfully merging this pull request may close these issues.

3 participants