From 8f5e04d79ea778340864cc2e8ce4c31613005fa4 Mon Sep 17 00:00:00 2001 From: Alin Gabriel Arhip Date: Thu, 18 May 2023 04:42:54 +0300 Subject: [PATCH] Auxiliary constructor example needs non-implicit parameter list. The auxiliary constructor (zero-arg) "this" needs an empty parameter list. --- _cheatsheets/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_cheatsheets/index.md b/_cheatsheets/index.md index 41e35e3eb2..679e4ed242 100644 --- a/_cheatsheets/index.md +++ b/_cheatsheets/index.md @@ -331,7 +331,7 @@ breakable { var y = x val readonly = 5 private var secret = 1 - def this = this(42) + def this() = this(42) } Constructor is class body.
Declare a public member.
Declare a gettable but not settable member.
Declare a private member.
Alternative constructor.