1
0
forked from Mirror/wren

Add test for default constructor.

This commit is contained in:
Bob Nystrom
2013-12-10 21:58:02 -08:00
parent 03c7b01b0f
commit 510e3fc383

View File

@ -0,0 +1,11 @@
class Foo {
toString { return "Foo" }
}
// A class with no constructors gets an argument-less "new" one by default.
var foo = Foo.new
io.write(foo is Foo) // expect: true
io.write(foo.toString) // expect: Foo
// TODO(bob): Test that class doesn't get default constructor if it has an
// explicit one.