def main
(args
: Array
[String
]) { val l
= List
(new AClass, AnObject, ACompanionExample
) l.map(a => a.autocorrect)
.foreach(println)
}
}
def autocorrect
: String
// this is abstract }
def autocorrect
= "AClass autocorrect" }
def autocorrect
= "AnObject autocorrect" }
def autocorrect
= "CompanionExample autocorrect" }
Cm9iamVjdCBNYWluIHsKICBkZWYgbWFpbihhcmdzOiBBcnJheVtTdHJpbmddKSB7CiAgICAgIHZhbCBsID0gTGlzdChuZXcgQUNsYXNzLCBBbk9iamVjdCwgQUNvbXBhbmlvbkV4YW1wbGUpCiAgICAgIGwubWFwKGEgPT4gYS5hdXRvY29ycmVjdCkKICAgICAgLmZvcmVhY2gocHJpbnRsbikKICB9Cgp9Cgp0cmFpdCBBdXRvY29ycmVjdG9yIHsKICBkZWYgYXV0b2NvcnJlY3Q6IFN0cmluZyAvLyB0aGlzIGlzIGFic3RyYWN0Cn0KCmNsYXNzIEFDbGFzcyBleHRlbmRzIEF1dG9jb3JyZWN0b3IgewogIGRlZiBhdXRvY29ycmVjdCA9ICJBQ2xhc3MgYXV0b2NvcnJlY3QiCn0KCm9iamVjdCBBbk9iamVjdCBleHRlbmRzIEF1dG9jb3JyZWN0b3IgewogIGRlZiBhdXRvY29ycmVjdCA9ICJBbk9iamVjdCBhdXRvY29ycmVjdCIKfQoKY2xhc3MgQUNvbXBhbmlvbkV4YW1wbGUKb2JqZWN0IEFDb21wYW5pb25FeGFtcGxlIGV4dGVuZHMgQXV0b2NvcnJlY3RvciB7CiAgZGVmIGF1dG9jb3JyZWN0ID0gIkNvbXBhbmlvbkV4YW1wbGUgYXV0b2NvcnJlY3QiCn0K