pocketlang icon indicating copy to clipboard operation
pocketlang copied to clipboard

[Bugfix] native class can be inherited in script

Open khchen opened this issue 1 year ago • 0 comments

Example:

from types import Vector

class Vector2 is Vector
  def *=(n)
    self.x *= n; self.y *= n; self.z *= n
    return self
  end
end

v = Vector2(1, 2, 3)
v *= 2
print(v)

Output:

[2, 4, 6]

khchen avatar Jul 21 '22 03:07 khchen