Make IO.write() call toString on its argument.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
class Foo {
|
||||
toString { return "Foo.toString" }
|
||||
}
|
||||
|
||||
// Calls toString on argument.
|
||||
IO.write(new Foo) // expect: Foo.toString
|
||||
|
||||
// Returns argument.
|
||||
var result = IO.write(123) // expect: 123
|
||||
IO.write(result == 123) // expect: true
|
||||
|
||||
// TODO: What if toString on argument doesn't return a string?
|
||||
Reference in New Issue
Block a user