J2K: default parameter values generated for secondary constructors too
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
class A {
|
||||
private String s = "";
|
||||
private int x = 0;
|
||||
|
||||
public A(){
|
||||
}
|
||||
|
||||
public A(int p, String s){
|
||||
this(p, s, 1);
|
||||
}
|
||||
|
||||
public A(int p, String s, int x){
|
||||
this.s = s;
|
||||
this.x = x;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// ERROR: Val cannot be reassigned
|
||||
// ERROR: Val cannot be reassigned
|
||||
class A {
|
||||
private val s = ""
|
||||
private val x = 0
|
||||
|
||||
public constructor() {
|
||||
}
|
||||
|
||||
overloads public constructor(p: Int, s: String, x: Int = 1) {
|
||||
this.s = s
|
||||
this.x = x
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user