Skip to content

Instantly share code, notes, and snippets.

View dasl-'s full-sized avatar

David Leibovic dasl-

View GitHub Profile
diff --git a/src/Phan/Analysis/PostOrderAnalysisVisitor.php b/src/Phan/Analysis/PostOrderAnalysisVisitor.php
index a7557675d..2f02e2619 100644
--- a/src/Phan/Analysis/PostOrderAnalysisVisitor.php
+++ b/src/Phan/Analysis/PostOrderAnalysisVisitor.php
@@ -1632,6 +1632,7 @@ class PostOrderAnalysisVisitor extends AnalysisVisitor
foreach ($this->getReturnTypes($context, $expr, $node->lineno) as $lineno => [$expression_type, $inner_node]) {
// If there is no declared type, see if we can deduce
// what it should be based on the return type
+ // TODO: this check could be performed outside the for loop? more efficient.
if ($method_return_type->isEmpty()
diff --git a/src/Phan/Analysis/PostOrderAnalysisVisitor.php b/src/Phan/Analysis/PostOrderAnalysisVisitor.php
index a7557675d..649508cef 100644
--- a/src/Phan/Analysis/PostOrderAnalysisVisitor.php
+++ b/src/Phan/Analysis/PostOrderAnalysisVisitor.php
@@ -1632,6 +1632,7 @@ class PostOrderAnalysisVisitor extends AnalysisVisitor
foreach ($this->getReturnTypes($context, $expr, $node->lineno) as $lineno => [$expression_type, $inner_node]) {
// If there is no declared type, see if we can deduce
// what it should be based on the return type
+ // TODO: this check could be performed outside the for loop? more efficient.
if ($method_return_type->isEmpty()
diff --git a/src/Phan/Analysis/PostOrderAnalysisVisitor.php b/src/Phan/Analysis/PostOrderAnalysisVisitor.php
index a7557675d..649508cef 100644
--- a/src/Phan/Analysis/PostOrderAnalysisVisitor.php
+++ b/src/Phan/Analysis/PostOrderAnalysisVisitor.php
@@ -1632,6 +1632,7 @@ class PostOrderAnalysisVisitor extends AnalysisVisitor
foreach ($this->getReturnTypes($context, $expr, $node->lineno) as $lineno => [$expression_type, $inner_node]) {
// If there is no declared type, see if we can deduce
// what it should be based on the return type
+ // TODO: this check could be performed outside the for loop? more efficient.
if ($method_return_type->isEmpty()
diff --git a/src/Phan/Analysis/PostOrderAnalysisVisitor.php b/src/Phan/Analysis/PostOrderAnalysisVisitor.php
index a7557675d..14a631059 100644
--- a/src/Phan/Analysis/PostOrderAnalysisVisitor.php
+++ b/src/Phan/Analysis/PostOrderAnalysisVisitor.php
@@ -1632,6 +1632,7 @@ class PostOrderAnalysisVisitor extends AnalysisVisitor
foreach ($this->getReturnTypes($context, $expr, $node->lineno) as $lineno => [$expression_type, $inner_node]) {
// If there is no declared type, see if we can deduce
// what it should be based on the return type
+ // TODO: this check could be performed outside the for loop? more efficient.
if ($method_return_type->isEmpty()
diff --git a/src/Phan/Analysis/PostOrderAnalysisVisitor.php b/src/Phan/Analysis/PostOrderAnalysisVisitor.php
index a7557675d..089072f24 100644
--- a/src/Phan/Analysis/PostOrderAnalysisVisitor.php
+++ b/src/Phan/Analysis/PostOrderAnalysisVisitor.php
@@ -1632,7 +1632,8 @@ class PostOrderAnalysisVisitor extends AnalysisVisitor
foreach ($this->getReturnTypes($context, $expr, $node->lineno) as $lineno => [$expression_type, $inner_node]) {
// If there is no declared type, see if we can deduce
// what it should be based on the return type
- if ($method_return_type->isEmpty()
+ // TODO: this check could be performed outside the for loop? more efficient.
diff --git a/src/Phan/Analysis/PostOrderAnalysisVisitor.php b/src/Phan/Analysis/PostOrderAnalysisVisitor.php
index a7557675d..cf5a13993 100644
--- a/src/Phan/Analysis/PostOrderAnalysisVisitor.php
+++ b/src/Phan/Analysis/PostOrderAnalysisVisitor.php
@@ -1632,7 +1632,7 @@ class PostOrderAnalysisVisitor extends AnalysisVisitor
foreach ($this->getReturnTypes($context, $expr, $node->lineno) as $lineno => [$expression_type, $inner_node]) {
// If there is no declared type, see if we can deduce
// what it should be based on the return type
- if ($method_return_type->isEmpty()
+ if (true || $method_return_type->isEmpty()
diff --git a/src/Phan/AST/ContextNode.php b/src/Phan/AST/ContextNode.php
index 64d688472..a941f3f35 100644
--- a/src/Phan/AST/ContextNode.php
+++ b/src/Phan/AST/ContextNode.php
@@ -50,6 +50,7 @@ use Phan\Language\Type\StringType;
use Phan\Language\UnionType;
use Phan\Library\FileCache;
use Phan\Library\None;
+use Phan\Library\Set;
diff --git a/src/Phan/AST/ContextNode.php b/src/Phan/AST/ContextNode.php
index 64d688472..13d44094e 100644
--- a/src/Phan/AST/ContextNode.php
+++ b/src/Phan/AST/ContextNode.php
@@ -50,6 +50,7 @@ use Phan\Language\Type\StringType;
use Phan\Language\UnionType;
use Phan\Library\FileCache;
use Phan\Library\None;
+use Phan\Library\Set;
@dasl-
dasl- / foo.diff
Last active December 29, 2023 19:22
diff --git a/go/vt/vtgate/vindexes/hybrid.go b/go/vt/vtgate/vindexes/hybrid.go
index 55ad0fe773..fd1c40b063 100644
--- a/go/vt/vtgate/vindexes/hybrid.go
+++ b/go/vt/vtgate/vindexes/hybrid.go
@@ -28,6 +28,7 @@ import (
var (
_ SingleColumn = (*Hybrid)(nil)
+ hybridVindexes = make(map[string]Vindex)
)
diff --git a/src/Phan/Analysis/PostOrderAnalysisVisitor.php b/src/Phan/Analysis/PostOrderAnalysisVisitor.php
index a7557675d..1d51b9c63 100644
--- a/src/Phan/Analysis/PostOrderAnalysisVisitor.php
+++ b/src/Phan/Analysis/PostOrderAnalysisVisitor.php
@@ -1621,31 +1621,31 @@ class PostOrderAnalysisVisitor extends AnalysisVisitor
// Check for failing to return a value, or returning a value in a void method.
if ($method_return_type->hasRealTypeSet()) {
if (!$this->checkIsValidReturnExpressionForType($node, $method_return_type->asRealUnionType(), $method)) {
return $context;
}