Skip to content

Commit 7681545

Browse files
authored
Avoid deprecation warning (scala#1732)
This change fixes the following compiler warning: procedure syntax is deprecated for constructors: add `=`, as in method definition
1 parent bc36836 commit 7681545

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

_overviews/scala-book/classes-aux-constructors.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ val DefaultCrustType = "THIN"
2828
class Pizza (var crustSize: Int, var crustType: String) {
2929

3030
// one-arg auxiliary constructor
31-
def this(crustSize: Int) {
31+
def this(crustSize: Int) = {
3232
this(crustSize, DefaultCrustType)
3333
}
3434

3535
// one-arg auxiliary constructor
36-
def this(crustType: String) {
36+
def this(crustType: String) = {
3737
this(DefaultCrustSize, crustType)
3838
}
3939

4040
// zero-arg auxiliary constructor
41-
def this() {
41+
def this() = {
4242
this(DefaultCrustSize, DefaultCrustType)
4343
}
4444

0 commit comments

Comments
 (0)