Skip to content

Commit 920033a

Browse files
m-schmidtxavierleroy
authored andcommitted
bug 39368, one also needs to check for a direct match of the field name of anonymous structs
1 parent 31ee27e commit 920033a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cparser/Elab.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,6 +1542,9 @@ module I = struct
15421542
| TUnion(id, _), Init_union(id', fld, i) ->
15431543
if fld.fld_name = name then
15441544
OK(Zunion(z, id, fld), i)
1545+
else if fld.fld_anonymous && has_member env name fld.fld_typ then
1546+
let zi = (Zunion(z, id, fld), i) in
1547+
member env zi name
15451548
else begin
15461549
let rec find = function
15471550
| [] -> NotFound

0 commit comments

Comments
 (0)