Unify body handling.
Blocks, functions, and methods now have the same code for handling their bodies. This means that single-line methods work like single-line functions: they return the result of their expression.
This commit is contained in:
@@ -9,7 +9,7 @@ IO.print([1, [2, [3], 4], 5]) // expect: [1, [2, [3], 4], 5]
|
||||
|
||||
// Calls toString on elements.
|
||||
class Foo {
|
||||
toString { return "Foo.toString" }
|
||||
toString { "Foo.toString" }
|
||||
}
|
||||
|
||||
IO.print([1, new Foo, 2]) // expect: [1, Foo.toString, 2]
|
||||
|
||||
Reference in New Issue
Block a user