-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
It is currently a syntax error if the first token of the argument to pointerof is a self:
class Foo
@x : Int32
def foo
pointerof(self) # Error: can't take address of self
pointerof(self.@x) # Error: can't take address of self
end
endThere is, however, nothing wrong with the second line; if you can take a pointer to a different instance's ivar, i.e. bar = Foo.new; pointerof(bar.@x), and self.@x works outside pointerof, then it makes sense that pointerof(self.@x) should be equivalent to pointerof(@x) in the above example.
(This is only about ReadInstanceVar and should not be confused with #15903.)
Reactions are currently unavailable