There was an error while loading. Please reload this page.
1 parent a1544f7 commit 00ff84cCopy full SHA for 00ff84c
2 files changed
compiler/src/dmd/dinterpret.d
@@ -2907,7 +2907,8 @@ public:
2907
for (ClassDeclaration c = cd; c; c = c.baseClass)
2908
totalFieldCount += c.fields.length;
2909
2910
- totalFieldCount -= cd.hasMonitor(); // skip __monitor field
+ if (totalFieldCount)
2911
+ totalFieldCount -= cd.hasMonitor(); // skip __monitor field
2912
2913
auto elems = new Expressions(totalFieldCount);
2914
ptrdiff_t fieldsSoFar = totalFieldCount;
compiler/test/compilable/reg22766.d
@@ -0,0 +1,11 @@
1
+/*
2
+TEST_OUTPUT:
3
+---
4
+C22766()
5
6
+*/
7
+module object;
8
+
9
+class C22766 { }
10
11
+pragma(msg, new C22766);
0 commit comments