-
Notifications
You must be signed in to change notification settings - Fork 737
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SCLang: Too many args passed to certain 'inline' methods
When the compile/parser see a method with only a single call, or a call to `super.something`, it 'inlines' it. For these methods, all the users arguments were being passed through, regardless of how many were declared in the function signature. This commit checks this, and removes any excess args from the stack. Closes #1087
- Loading branch information
JordanHendersonMusic
committed
May 9, 2024
1 parent
96c4fc5
commit ffe7f32
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
TestCorrectArgCountObj { | ||
var <a, <b, <c; | ||
*new {|a| ^super.newCopyArgs(a) } | ||
} | ||
TestCorrectArgCount : UnitTest { | ||
test_correct_arg { | ||
var o = TestCorrectArgCountObj(\a, \b, \c); | ||
this.assertEquals(o.a, \a); | ||
this.assertEquals(o.b, nil); | ||
this.assertEquals(o.c, nil); | ||
} | ||
} |