Consider the following program:
type mymethod is method()->(int)
&int x = new 1
Doesn't compile, as the type checker says that we return a function where a method is expected.
Change the type declaration to type mymethod is function()->(int), and then the compiler complains that dereference is not permitted in functions.
type mymethod is function()->(int)
Related to #611
Chaning the return statement to return &(->(*x) + *(new 0)) makes it compile, because it is then detected as method. Looks like only new expressions make a lambda to a method right now.
return &(->(*x) + *(new 0))
Yeah, this is to do with the rather awkward may that methods are inferred for lambdas. Having an explicit syntax to indicate that a lambda is a function or method would be another solution.
But, I still think that the subtyping option makes sense.