We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reading of uninitialized variables in methods is currently broken.
The following test fails with an assertion, because the read evaluates to null:
null
class Test usingPlatform: platform = Value ()( protected foo = ( | a | a println. a := 1. a println. ) public main: args = ( foo. foo. ^ 0 ) )
A fix could be:
diff --git a/src/som/compiler/MethodBuilder.java b/src/som/compiler/MethodBuilder.java index 1598a2b..20e8757 100644 --- a/src/som/compiler/MethodBuilder.java +++ b/src/som/compiler/MethodBuilder.java @@ -101,7 +102,8 @@ public final class MethodBuilder { MethodScope outer = (outerBuilder != null) ? outerBuilder.getCurrentMethodScope() : null; - this.currentScope = new MethodScope(new FrameDescriptor(), outer, clsScope); + assert Nil.nilObject != null; + this.currentScope = new MethodScope(new FrameDescriptor(Nil.nilObject), outer, clsScope); accessesVariablesOfOuterScope = false; throwsNonLocalReturn = false;
The text was updated successfully, but these errors were encountered:
be22915
No branches or pull requests
Reading of uninitialized variables in methods is currently broken.
The following test fails with an assertion, because the read evaluates to
null
:A fix could be:
The text was updated successfully, but these errors were encountered: