Skip to content

Commit 15f83e8

Browse files
committed
chore: deprecate scala.annotation.transparentTrait
1 parent 9bee756 commit 15f83e8

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

compiler/src/dotty/tools/dotc/core/Definitions.scala

-1
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,6 @@ class Definitions {
10481048
@tu lazy val NowarnAnnot: ClassSymbol = requiredClass("scala.annotation.nowarn")
10491049
@tu lazy val UnusedAnnot: ClassSymbol = requiredClass("scala.annotation.unused")
10501050
@tu lazy val UnrollAnnot: ClassSymbol = requiredClass("scala.annotation.unroll")
1051-
@tu lazy val TransparentTraitAnnot: ClassSymbol = requiredClass("scala.annotation.transparentTrait")
10521051
@tu lazy val NativeAnnot: ClassSymbol = requiredClass("scala.native")
10531052
@tu lazy val RepeatedAnnot: ClassSymbol = requiredClass("scala.annotation.internal.Repeated")
10541053
@tu lazy val RuntimeCheckedAnnot: ClassSymbol = requiredClass("scala.annotation.internal.RuntimeChecked")

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

+1-3
Original file line numberDiff line numberDiff line change
@@ -1220,9 +1220,7 @@ object SymDenotations {
12201220
|| accessBoundary(defn.RootClass).isProperlyContainedIn(symbol.topLevelClass)
12211221

12221222
final def isTransparentClass(using Context): Boolean =
1223-
is(TransparentType)
1224-
|| defn.isAssumedTransparent(symbol)
1225-
|| isClass && hasAnnotation(defn.TransparentTraitAnnot)
1223+
is(TransparentType) || defn.isAssumedTransparent(symbol)
12261224

12271225
/** The class containing this denotation which has the given effective name. */
12281226
final def enclosingClassNamed(name: Name)(using Context): Symbol = {

library/src/scala/annotation/transparentTrait.scala

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ package scala.annotation
55
* are not inferred when combined with other types in an intersection.
66
* See reference/other-new-features/transparent-traits.html for details.
77
*/
8+
@deprecated(message = "Transparent traits/classes via annotations is no longer supported. Use instead the `transparent` modifier", since = "3.8.0")
89
final class transparentTrait extends StaticAnnotation

0 commit comments

Comments
 (0)