Skip to content

Commit 9ecb896

Browse files
committed
Fix missing default value in untyped parameter declarations
Only affects static analysis.
1 parent c4bc341 commit 9ecb896

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/com/laytonsmith/core/functions/DataHandling.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,8 @@ public Scope[] linkParamScope(StaticAnalysis analysis, Scope paramScope, Scope v
574574

575575
// Add the new variable declaration.
576576
paramScope = analysis.createNewScope(paramScope);
577-
ParamDeclaration pDecl = new ParamDeclaration(iVar.getVariableName(), type, ast.getChildAt(2),
577+
ParamDeclaration pDecl = new ParamDeclaration(iVar.getVariableName(), type,
578+
(ast.getChildAt(2).getData() == CNull.UNDEFINED ? null : ast.getChildAt(2)),
578579
ast.getNodeModifiers(),
579580
ast.getTarget());
580581
params.add(pDecl);
@@ -602,8 +603,9 @@ public Scope[] linkParamScope(StaticAnalysis analysis, Scope paramScope, Scope v
602603
// Add the new variable declaration.
603604
paramScope = analysis.createNewScope(paramScope);
604605
ParamDeclaration pDecl = new ParamDeclaration(
605-
iVar.getVariableName(), CClassType.AUTO, null, ast.getNodeModifiers(),
606-
ast.getTarget());
606+
iVar.getVariableName(), CClassType.AUTO,
607+
(ast.getChildAt(1).getData() == CNull.UNDEFINED ? null : ast.getChildAt(1)),
608+
ast.getNodeModifiers(), ast.getTarget());
607609
params.add(pDecl);
608610
paramScope.addDeclaration(pDecl);
609611
analysis.setTermScope(ivarAst, paramScope);

0 commit comments

Comments
 (0)