Skip to content

Commit 2cac84a

Browse files
committed
Fix code in 'Scala Tour / Singleton Objects / Companion Objects'
1 parent 57b7aba commit 2cac84a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

_tour/singleton-objects.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ An object with the same name as a class is called a _companion object_. Converse
104104

105105
{% tab 'Scala 2' for=companion-object-circle %}
106106
```scala
107+
import scala.math.Pi
107108
import scala.math.pow
108109

109110
case class Circle(radius: Double) {
@@ -123,7 +124,7 @@ circle1.area
123124

124125
{% tab 'Scala 3' for=companion-object-circle %}
125126
```scala
126-
import scala.math.pow
127+
import scala.math.{Pi, pow}
127128

128129
case class Circle(radius: Double):
129130
import Circle.*

0 commit comments

Comments
 (0)