File tree Expand file tree Collapse file tree 5 files changed +8
-5
lines changed
Expand file tree Collapse file tree 5 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -1835,6 +1835,8 @@ bool isCtfeValueValid(Expression newval)
18351835 return true ; // ((StructLiteralExp *)newval)->ownedByCtfe;
18361836 if (newval.op == TOK .classReference)
18371837 return true ;
1838+ if (newval.op == TOK .type)
1839+ return true ;
18381840 if (newval.op == TOK .vector)
18391841 return true ; // vector literal
18401842 if (newval.op == TOK .function_)
Original file line number Diff line number Diff line change @@ -2085,7 +2085,7 @@ public:
20852085 }
20862086 return ;
20872087 }
2088- assert (result.op == TOK .structLiteral || result.op == TOK .classReference);
2088+ assert (result.op == TOK .structLiteral || result.op == TOK .classReference || result.op == TOK .type );
20892089 return ;
20902090 }
20912091 e.error(" value of `this` is not known at compile time" );
@@ -5071,7 +5071,8 @@ public:
50715071 result = CTFEExp.cantexp;
50725072 return ;
50735073 }
5074- assert (pthis.op == TOK .structLiteral || pthis.op == TOK .classReference);
5074+
5075+ assert (pthis.op == TOK .structLiteral || pthis.op == TOK .classReference || pthis.op == TOK .type);
50755076
50765077 if (fd.isVirtual() && ! e.directcall)
50775078 {
Original file line number Diff line number Diff line change 11/*
22TEST_OUTPUT:
33---
4- fail_compilation/fail4206.d(9): Error: cannot interpret `s` at compile time
4+ fail_compilation/fail4206.d(9): Error: initializer must be an expression, not `s`
55---
66*/
77
Original file line number Diff line number Diff line change 11/*
22TEST_OUTPUT:
33---
4- fail_compilation/ice11919.d(17): Error: cannot interpret `foo` at compile time
4+ fail_compilation/ice11919.d(17): Error: initializer must be an expression, not `foo`
55fail_compilation/imports/a11919.d(4): Error: template instance `a11919.doBar!(Foo).doBar.zoo!(t)` error instantiating
66fail_compilation/imports/a11919.d(11): instantiated from here: `doBar!(Foo)`
77fail_compilation/ice11919.d(25): instantiated from here: `doBar!(Bar)`
Original file line number Diff line number Diff line change 11/*
22TEST_OUTPUT:
33---
4- fail_compilation/ice12362.d(12): Error: cannot interpret `foo` at compile time
4+ fail_compilation/ice12362.d(12): Error: initializer must be an expression, not `foo`
55---
66*/
77
You can’t perform that action at this time.
0 commit comments