vapourlang / vapour

Typed superset of R
http://vapour.run
Apache License 2.0
190 stars 3 forks source link

Method exists #30

Open JohnCoene opened 2 months ago

JohnCoene commented 2 months ago

Check whether method exists.

type x: object {
  thing: bool
}

type y: object {
  another_thing: bool
}

func (obj: x) foo(): null {
  print("It's x!")
}

foo(x)

# this should fail
foo(y)
JohnCoene commented 2 months ago

Requires R type inference