Cache TypeIdExp::semantic

This commit is contained in:
Dennis Korpel 2024-12-03 22:13:20 +01:00 committed by The Dlang Bot
parent d8c0e79bfb
commit bfae7828a9
2 changed files with 6 additions and 3 deletions

View file

@ -7130,6 +7130,11 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
{
printf("TypeidExp::semantic() %s\n", exp.toChars());
}
if (exp.type)
{
result = exp;
return;
}
Type ta = isType(exp.obj);
Expression ea = isExpression(exp.obj);
Dsymbol sa = isDsymbol(exp.obj);

View file

@ -1,9 +1,7 @@
// https://issues.dlang.org/show_bug.cgi?id=19227
/* TEST_OUTPUT:
---
compilable/test19227.d(18): Deprecation: use of complex type `cfloat` is deprecated, use `std.complex.Complex!(float)` instead
Deprecation: use of complex type `const(cfloat)` is deprecated, use `std.complex.Complex!(float)` instead
Deprecation: use of complex type `const(cfloat)` is deprecated, use `std.complex.Complex!(float)` instead
compilable/test19227.d(16): Deprecation: use of complex type `cfloat` is deprecated, use `std.complex.Complex!(float)` instead
Deprecation: use of complex type `const(cfloat)` is deprecated, use `std.complex.Complex!(float)` instead
---
*/