From 519ad7b292622022623ba14566e7cb06c95b0659 Mon Sep 17 00:00:00 2001 From: tianfenghan Date: Tue, 12 May 2026 20:41:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(aot):=20=E4=BF=AE=E5=A4=8D=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E7=B1=BB=E5=9E=8B=E6=A3=80=E6=9F=A5=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=B9=B6=E6=9B=B4=E6=96=B0=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除多余的变量类型验证检查逻辑 - 更新测试用例中的类型注解以匹配实际实现 - 修正 EsmtpTransport 类型在配置方法中的使用 --- src/Php/CompilerBase.php | 4 ---- tests/aot/type_hits/005.phpt | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Php/CompilerBase.php b/src/Php/CompilerBase.php index aef6483b..963ea948 100644 --- a/src/Php/CompilerBase.php +++ b/src/Php/CompilerBase.php @@ -5323,10 +5323,6 @@ class CompilerBase extends \PhpAot\Core\Translator { if (!$this->hasVar($name)) { $this->addLocalVar($name, $defaultType); - } elseif ($defaultType === self::TYPE_VAR) { - if ($this->getVarType($name) !== self::TYPE_VAR) { - $this->fatalError($node, 'Cannot assign value to variable $' . $name . ' of type ' . $this->getVarType($name)); - } } else { if ($this->getVarType($name) !== $defaultType) { $this->fatalError($node, 'Cannot assign value to variable $' . $name . ' of type ' . $this->getVarType($name) . ' with type ' . $defaultType); diff --git a/tests/aot/type_hits/005.phpt b/tests/aot/type_hits/005.phpt index a1f8faff..0b586e1d 100644 --- a/tests/aot/type_hits/005.phpt +++ b/tests/aot/type_hits/005.phpt @@ -30,7 +30,7 @@ class Baz { } class FooB { - function configure(FooA $o) { + function configure(EsmtpTransport $o) { $o->send('Hello World', 'foo@bar'); } }