mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
ImportC: can't access members in static array (#21185)
Fixes https://github.com/dlang/dmd/issues/20472 Arrays in C implicitly convert to a pointer to their first member, so do the implicit conversion when using them in an arrow member lookup.
This commit is contained in:
parent
7dd0506aaf
commit
ca2f90d1fc
3 changed files with 21 additions and 2 deletions
|
@ -126,6 +126,12 @@ Expression fieldLookup(Expression e, Scope* sc, Identifier id, bool arrow)
|
|||
e = e.expressionSemantic(sc);
|
||||
if (e.isErrorExp())
|
||||
return e;
|
||||
if (arrow)
|
||||
{
|
||||
e = arrayFuncConv(e, sc);
|
||||
if (e.isErrorExp())
|
||||
return e;
|
||||
}
|
||||
|
||||
auto t = e.type;
|
||||
if (t.isTypePointer())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue