nitlang / nit

Nit language
http://nitlanguage.org
Apache License 2.0
238 stars 64 forks source link

Callref norecv #2805

Closed Louis-Vincent closed 2 weeks ago

Louis-Vincent commented 4 years ago

This PR introduces callref without receiver. Here's an example :

import functional
class A
    var x: Int
    fun toto: Int do return x + 1
end

var a = new A(10)
var toto = &A.toto
assert toto.call(a) == 11