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

2.063: AA value type merging issues #407

Closed
dnadlinger opened this issue Jun 16, 2013 · 9 comments
Closed

2.063: AA value type merging issues #407

dnadlinger opened this issue Jun 16, 2013 · 9 comments

Comments

@dnadlinger
Copy link
Member

The following fragment, extracted from the std.traits unit tests

private struct QualifiedNameTests {
    struct Inner {}
    shared(const(Inner[int])[]) data;
}

fails with Error: cannot create associative array const(Inner)[int], because somehow, Inner in the AA value type is resolved to a Tident instance of Type.

The whole thing is rather sensitive to the qualifiers, but I couldn't find out where the merging goes wrong yet.

@dnadlinger
Copy link
Member Author

The point where a Tident-reliant Type appears is while generating the TypeInfo for the type of data, more specifically, when calling unSharedOf in TypeInfoSharedDeclaration::llvmDefine.

Still not sure what is really going wrong here.

@redstar
Copy link
Member

redstar commented Sep 17, 2013

At least some progress. I used this issue as an excuse for not creating the next release...

@dnadlinger
Copy link
Member Author

It is a good excuse indeed, and yes, we need to get this fixed asap.

@dnadlinger
Copy link
Member Author

Another 10 minutes on the bus, another data point: On LDC master, the Type referenced by the TypeInfoSharedDeclaration is shared(const(Inner[int])), whereas on DMD 2.063.2, it is shared(const(Inner)[int]) (note the different position of the const).

@dnadlinger
Copy link
Member Author

@redstar, @AlexeyProkhin: Any idea what could be going wrong here? The best idea I currently have for going about this would be to sprinkle all the type resolution/merging code with debugging code to figure out what the issue is, but I'm not sure I'll have the time to do that in the next few days.

@dnadlinger
Copy link
Member Author

Okay, #484 doesn't solve this, so the odds that it is actually a LDC-only bug in the type merging code are getting lower. Maybe it's a DMD bug, and it's just our constant use of stripModifiers that exposes it.

@UplinkCoder
Copy link
Contributor

Ehm ...
I looks to me as if this could be a lexer/parser issue

Consider the syntax
shared(const(SomeArrayIdentifier[Someindex]))
in that case Inner ist just the Identifier
as opposed to
shared(const(SomeTypeIdentifier)[SomeOtherType])
....
I really don't know any Internals of ldc or llvm
so if this is just nonesense please ignore it :D

@dnadlinger
Copy link
Member Author

@UplinkCoder: Good idea, but unfortunately, it's not that simple. Essentially, Tident is the class types are assigned to before they have been fully analyzed, i.e. still refer just an identifier in the code and not to an actual semantic entity. Eventually, all types should be resolved on their way through the compiler, but for some reason, this isn't.

redstar pushed a commit that referenced this issue Sep 27, 2014
redstar pushed a commit that referenced this issue Sep 27, 2014
- fixup for #407
- remove non-existent mak/posix.mak from MANIFEST
- add core.sys.linux.elf to MANIFEST and COPY
- add missing COPY entries in win32/64.mak
@dnadlinger
Copy link
Member Author

Fixed in master, although I don't exactly know when.

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

3 participants