Bug 19822 – 2.086 regression wrt. union initializers

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-04-24T19:12:14Z
Last change time
2019-04-30T11:16:49Z
Keywords
pull
Assigned to
No Owner
Creator
kinke

Comments

Comment #0 by kinke — 2019-04-24T19:12:14Z
This assertion fails since 2.086.0-beta.1: https://run.dlang.io/is/YvQvyE struct Quat { static struct Vec { int x; } union { Vec v; struct { float x; } } static Quat identity() { Quat q; q.x = 1.0f; return q; } } struct QuatContainerWithIncompatibleInit { Quat q = Quat.identity; } void main() { QuatContainerWithIncompatibleInit c; assert(c.q.x == 1.0f); // fails }
Comment #1 by default_357-line — 2019-04-24T19:25:52Z
I've tried to simplify it a bit: https://run.dlang.io/is/ilmKBT Fascinating bug. Lots of specific parts that are all necessary for some reason.
Comment #2 by slavo5150 — 2019-04-25T08:55:11Z
I'm not able to reproduce this with master.
Comment #3 by slavo5150 — 2019-04-30T00:24:12Z
(In reply to Mike Franklin from comment #2) > I'm not able to reproduce this with master. I figured it out. According to a digger bisection, this bug regression was introduced by https://github.com/dlang/dmd/pull/9547
Comment #4 by dlang-bot — 2019-04-30T08:01:57Z
@RazvanN7 created dlang/dmd pull request #9730 "Fix Issue 19822 - 2.086 regression wrt. union initializers" fixing this issue: - Fix Issue 19822 - 2.086 regression wrt. union initializers https://github.com/dlang/dmd/pull/9730
Comment #5 by dlang-bot — 2019-04-30T11:16:49Z
dlang/dmd pull request #9730 "Fix Issue 19822 - 2.086 regression wrt. union initializers" was merged into stable: - d72e1663ce41a601de7010dc2e9a6d207c3bf39b by RazvanN7: Fix Issue 19822 - 2.086 regression wrt. union initializers https://github.com/dlang/dmd/pull/9730