2015-07-10 09:18:22 -07:00
|
|
|
class Foo {
|
2015-07-21 07:24:53 -07:00
|
|
|
construct named() { _field = "named" }
|
|
|
|
|
construct other() { _field = "other" }
|
2015-07-10 09:18:22 -07:00
|
|
|
|
|
|
|
|
toString { _field }
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-15 07:46:09 -07:00
|
|
|
System.print(Foo.named()) // expect: named
|
|
|
|
|
System.print(Foo.other()) // expect: other
|
2015-07-10 09:18:22 -07:00
|
|
|
|
|
|
|
|
// Returns the new instance.
|
|
|
|
|
var foo = Foo.named()
|
2015-09-15 07:46:09 -07:00
|
|
|
System.print(foo is Foo) // expect: true
|
|
|
|
|
System.print(foo.toString) // expect: named
|