Skip to content

Commit aff9ea8

Browse files
committed
Restrict constant values
1 parent f817838 commit aff9ea8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

build/gen_stub.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1847,6 +1847,9 @@ public function getDeclaration(iterable $allConstInfos): string
18471847
}
18481848

18491849
$value = EvaluatedValue::createFromExpression($this->value, $type, $this->cname, $allConstInfos);
1850+
if (!$value->isUnknownConstValue && !$value->originatingConst) {
1851+
throw new Exception("Constant " . $this->name->__toString() . " must have either UNKNOWN or a constant value");
1852+
}
18501853

18511854
$code = "";
18521855

0 commit comments

Comments
 (0)