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
Global variable initializer type does not match global variable type #2108
Comments
The following code seems to trigger the same error:
Compiler output:
Output of
|
Reduced with dustmite:
Also fails on 1.3.0-beta2 |
Thank you very much @ennis. |
struct Vec { float v; }
struct Quat
{
union
{
Vec v;
struct { float x; }
}
@nogc static Quat identity() pure nothrow @property
{
Quat q;
q.x = 1; // q.v.v = 1;
return q;
}
}
struct S
{
Quat q = Quat.identity;
} Crashes with initializer type mismatch. The commented-out code also crashes, but this time when generating the ModuleInfo... a jewel of a testcase. Almost certainly due to the union of course and the difficulty of expressing it in LLVM IR. Edit: Sorry, the 2nd crash is due to a dirty source tree on my side, initializing the primary union member compiles fine with beta2. |
The potentially multiple LL types for a single D union (and all aggregates containing it such as struct |
Thereby allowing T.init with explicit initializers for dominated members in nested unions, fixing issue ldc-developers#2108.
Thereby allowing T.init with explicit initializers for dominated members in nested unions, fixing issue ldc-developers#2108.
Fix issue #2108 (triggered by T.init initializing dominated members in nested unions)
ennis' testcase fixed by #2171. @MrSmith33: Please check again with Windows CI build 3897 here. It should be downloadable in about half an hour. |
@kinke: |
Are you using the 64-bit build? And which Windows version? |
I downloaded |
I tried splitting project into two parts. One part still fails with |
It seems to compile now, but fails to link with some system libs, (possibly a dub bug) I have
|
Alright, the original issue seems to be fixed as expected then, thanks for confirming -> closing. |
Thereby allowing T.init with explicit initializers for dominated members in nested unions, fixing issue ldc-developers#2108.
Fails on 1.2.0 and 1.3.0-beta1 on Windows
Upd: And 1.1.1
P.S. Can we have debug release?
The text was updated successfully, but these errors were encountered: