Skip to content

Commit 1f03bd8

Browse files
committed
Fix return infer
1 parent 594ab04 commit 1f03bd8

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

EmmyLua/CodeAnalysis/Compilation/Analyzer/ResolveAnalyzer/ResolveAnalyzer.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,6 @@ private void ResolveReturn(UnResolved unResolved, AnalyzeContext analyzeContext)
159159
var idType = Context.Compilation.Db.QueryTypeFromId(id);
160160
if (idType is LuaMethodType methodType)
161161
{
162-
if (!methodType.MainSignature.ReturnType.Equals(Builtin.Unknown))
163-
{
164-
return;
165-
}
166-
167162
var block = unResolvedMethod.Block;
168163
var returnType = AnalyzeBlockReturns(block, out var _, analyzeContext);
169164
methodType.MainSignature.ReturnType = returnType;

EmmyLua/CodeAnalysis/Compilation/Analyzer/ResolveAnalyzer/ResolveDependencyGraph.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ private void CalcResolveReturn(UnResolved unResolved)
206206
var idType = context.Compilation.Db.QueryTypeFromId(id);
207207
if (idType is LuaMethodType methodType)
208208
{
209-
if (!methodType.MainSignature.ReturnType.Equals(Builtin.Unknown))
209+
if (!methodType.MainSignature.ReturnType.Equals(Builtin.Nil))
210210
{
211211
OnResolved?.Invoke(unResolved, ResolveState.UnResolveReturn);
212212
return;

0 commit comments

Comments
 (0)