protected function assertTypeMatchesValue(ITypeAnalysis $analysis, O\Expression $expression, IType $metadataType = null) { $type = $this->typeSystem->getTypeFromValue($expression->evaluate(O\EvaluationContext::staticContext(__NAMESPACE__, __CLASS__))); $this->assertEqualTypes($type, $analysis->getReturnTypeOf($expression)); if ($metadataType !== null) { $this->assertEqualTypes($metadataType, $type, $expression->compileDebug()); } }
protected final function getValue(O\Expression $expression) { return $expression->evaluate($this->evaluationContext); }