tonysparks / litac-lang

LitaC compiler in LitaC
7 stars 5 forks source link

add ability to put methods on any types #16

Closed tonysparks closed 1 year ago

tonysparks commented 1 year ago

Allow for method definitions on any type not just aggregate types.

Example:

func (this: i32) add(other: i32): i32 {
  return this + other
}

var result = 4_i32.add(4)
assert(result == 8)