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
A: class {
value:=0other: Intinit: funcfoo: func (v:=thisvalue) {
this other = v
}
}
B: class {
whatever:=1init: funcbar: func (w:=thiswhatever) ->Int {
a:=A new()
a foo()
a other
}
}
b:=B new()
something:=b bar(2)
The value of v in foo should be this value but this does not point to itself but rather to the calling object b and fails with: error: ‘example__B’ has no member named 'value'
The same happens if the last line is replaced with something := b bar(), then the default value of w in bar fails because this is undeclared (we're not calling from any object).