Skip to content

Commit 92129ec

Browse files
authored
Merge branch 'Baeldung:master' into scalatest-upgrade
2 parents 912fb91 + f8947c8 commit 92129ec

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

scala-akka/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ This module contains articles about the Akka library in Scala.
1313
- [Typed Mailboxes in Scala](https://www.baeldung.com/scala/typed-mailboxes)
1414
- [Discovering Actors in Akka](https://www.baeldung.com/scala/discovering-actors-in-akka)
1515
- [Different Ways to Stop Akka Actors](https://www.baeldung.com/scala/stop-akka-actors)
16-
- [Reading an Akka Response Body as a String](https://www.baeldung.com/scala/akka-response-body-to-string)
16+
- [Reading an Akka-HTTP Response Body as a String](https://www.baeldung.com/scala/akka-response-body-to-string)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.baeldung.scala3.transparent
2+
3+
object NonTransparent {
4+
trait Marker
5+
trait Genre {
6+
def name: String
7+
}
8+
object Horror extends Genre, Marker {
9+
override val name: String = "Horror"
10+
}
11+
object Comedy extends Genre, Marker {
12+
override val name: String = "Comedy"
13+
}
14+
val isScary = true
15+
val genre /*: Genre & Marker*/ = if (isScary) Horror else Comedy
16+
}
17+
18+
object Transparent {
19+
transparent trait Marker
20+
trait Genre {
21+
def name: String
22+
}
23+
object Horror extends Genre, Marker {
24+
override val name: String = "Horror"
25+
}
26+
object Comedy extends Genre, Marker {
27+
override val name: String = "Comedy"
28+
}
29+
val isScary = true
30+
val genre /*: Genre*/ = if (isScary) Horror else Comedy
31+
}

0 commit comments

Comments
 (0)