Skip to content

Commit 8f5e04d

Browse files
authored
Auxiliary constructor example needs non-implicit parameter list.
The auxiliary constructor (zero-arg) "this" needs an empty parameter list.
1 parent cc4d0b9 commit 8f5e04d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_cheatsheets/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ breakable {
331331
var y = x
332332
val readonly = 5
333333
private var secret = 1
334-
def this = this(42)
334+
def this() = this(42)
335335
}</code></pre></td>
336336
<td>Constructor is class body.<br />Declare a public member.<br />Declare a gettable but not settable member.<br />Declare a private member.<br />Alternative constructor.</td>
337337
</tr>

0 commit comments

Comments
 (0)