You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the object definition for Foo, the attempt to access self.baz within the init method results in a runtime error indicating that Foo has no baz, despite it being declared. This inconsistency should be addressed.
To Reproduce
Define an object Foo with has baz: int = 0;.
Access self.baz in the init method.
Run the code.
obj Foo {
has bar: str;
has baz: int = 0;
can init(bar: str) {
self.bar = bar;
print(self.baz); # <-- Run time error Foo has no baz.
}
}
Expected Outcome:
The baz attribute should be accessible in the init method without any runtime errors.
The text was updated successfully, but these errors were encountered:
Describe the bug
In the object definition for
Foo
, the attempt to accessself.baz
within theinit
method results in a runtime error indicating thatFoo
has nobaz
, despite it being declared. This inconsistency should be addressed.To Reproduce
Foo
withhas baz: int = 0;
.self.baz
in theinit
method.Expected Outcome:
The
baz
attribute should be accessible in theinit
method without any runtime errors.The text was updated successfully, but these errors were encountered: