Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Commit 58827c2

Browse files
author
MikhailArkhipov
committed
Merge branch '2018.9'
2 parents 7dbeffa + 79eea01 commit 58827c2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Analysis/Engine/Impl/Interpreter/Ast/AstAnalysisFunctionWalker.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void Walk() {
6565
var self = GetSelf();
6666
_selfType = (self as AstPythonConstant)?.Type as AstPythonType;
6767

68-
_overload.ReturnTypes.AddRange(_scope.GetTypesFromAnnotation(_target.ReturnAnnotation));
68+
_overload.ReturnTypes.AddRange(_scope.GetTypesFromAnnotation(_target.ReturnAnnotation).ExcludeDefault());
6969

7070
_scope.PushScope();
7171
if (self != null) {
@@ -163,7 +163,7 @@ public override bool Walk(IfStatement node) {
163163
}
164164

165165
public override bool Walk(ReturnStatement node) {
166-
foreach (var type in _scope.GetTypesFromValue(_scope.GetValueFromExpression(node.Expression))) {
166+
foreach (var type in _scope.GetTypesFromValue(_scope.GetValueFromExpression(node.Expression)).ExcludeDefault()) {
167167
_overload.ReturnTypes.Add(type);
168168
}
169169
return true; // We want to evaluate all code so all private variables in __new__ get defined

0 commit comments

Comments
 (0)