KT-2752: fixes after code review

This commit is contained in:
Alexey Andreev
2016-09-20 16:03:33 +03:00
parent 00867cb269
commit 6f7e7d8504
30 changed files with 380 additions and 138 deletions
@@ -1,15 +1,13 @@
// KT-2995 creating factory methods to simulate overloaded constructors don't work in JavaScript
// This test is incorrect, since both constructor and function must have the same name.
package foo
class Foo(val name: String)
//fun Foo() = Foo("<default-name>")
fun Foo(x: Int) = Foo("<$x>")
fun box(): String {
// TODO: Don't know another way to suppress the test
/*assertEquals("<default-name>", Foo().name)
assertEquals("BarBaz", Foo("BarBaz").name)*/
assertEquals("<123>", Foo(123).name)
assertEquals("BarBaz", Foo("BarBaz").name)
return "OK"
}