Skip to content

Commit fa3a7cc

Browse files
committed
Rename transparent -> inline
1 parent 296f048 commit fa3a7cc

File tree

84 files changed

+189
-226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+189
-226
lines changed

bench/tests/power-macro/PowerMacro.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import scala.quoted.Expr
22

33
object PowerMacro {
44

5-
inline def power(transparent n: Long, x: Double) = ~powerCode(n, '(x))
5+
inline def power(inline n: Long, x: Double) = ~powerCode(n, '(x))
66

77
def powerCode(n: Long, x: Expr[Double]): Expr[Double] =
88
if (n == 0) '(1.0)

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,11 +464,11 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
464464
* Strictly speaking we can't replace `O.x` with `42`. But this would make
465465
* most expressions non-constant. Maybe we can change the spec to accept this
466466
* kind of eliding behavior. Or else enforce true purity in the compiler.
467-
* The choice will be affected by what we will do with `transparent` and with
467+
* The choice will be affected by what we will do with `inline` and with
468468
* Singleton type bounds (see SIP 23). Presumably
469469
*
470470
* object O1 { val x: Singleton = 42; println("43") }
471-
* object O2 { transparent val x = 42; println("43") }
471+
* object O2 { inline val x = 42; println("43") }
472472
*
473473
* should behave differently.
474474
*
@@ -478,8 +478,8 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
478478
*
479479
* O2.x = 42
480480
*
481-
* Revisit this issue once we have standardized on `transparent`. Then we can demand
482-
* purity of the prefix unless the selection goes to a transparent val.
481+
* Revisit this issue once we have standardized on `inline`. Then we can demand
482+
* purity of the prefix unless the selection goes to a inline val.
483483
*
484484
* Note: This method should be applied to all term tree nodes that are not literals,
485485
* that can be idempotent, and that can have constant types. So far, only nodes

compiler/src/dotty/tools/dotc/ast/untpd.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
134134

135135
case class Inline() extends Mod(Flags.Inline)
136136

137-
case class Transparent() extends Mod(Flags.Transparent)
138-
139137
case class Enum() extends Mod(Flags.Enum)
140138
}
141139

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ object Annotations {
5757
}
5858

5959
/** An annotation indicating the body of a right-hand side,
60-
* typically of an inline or transparent method. Treated specially in
60+
* typically of an inline method. Treated specially in
6161
* pickling/unpickling and TypeTreeMaps
6262
*/
6363
abstract class BodyAnnotation extends Annotation {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,8 +764,8 @@ class Definitions {
764764
def ImplicitNotFoundAnnot(implicit ctx: Context) = ImplicitNotFoundAnnotType.symbol.asClass
765765
lazy val ForceInlineAnnotType = ctx.requiredClassRef("scala.forceInline")
766766
def ForceInlineAnnot(implicit ctx: Context) = ForceInlineAnnotType.symbol.asClass
767-
lazy val TransparentParamAnnotType = ctx.requiredClassRef("scala.annotation.internal.TransparentParam")
768-
def TransparentParamAnnot(implicit ctx: Context) = TransparentParamAnnotType.symbol.asClass
767+
lazy val InlineParamAnnotType = ctx.requiredClassRef("scala.annotation.internal.InlineParam")
768+
def InlineParamAnnot(implicit ctx: Context) = InlineParamAnnotType.symbol.asClass
769769
lazy val InvariantBetweenAnnotType = ctx.requiredClassRef("scala.annotation.internal.InvariantBetween")
770770
def InvariantBetweenAnnot(implicit ctx: Context) = InvariantBetweenAnnotType.symbol.asClass
771771
lazy val MigrationAnnotType = ctx.requiredClassRef("scala.annotation.migration")

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

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,6 @@ object Flags {
329329
/** A method that has default params */
330330
final val DefaultParameterized = termFlag(27, "<defaultparam>")
331331

332-
/** Labelled with `transparent` modifier */
333-
final val Transparent = commonFlag(29, "transparent")
334-
335332
/** Symbol is defined by a Java class */
336333
final val JavaDefined = commonFlag(30, "<java>")
337334

@@ -436,7 +433,7 @@ object Flags {
436433

437434
/** Flags representing source modifiers */
438435
final val SourceModifierFlags =
439-
commonFlags(Private, Protected, Abstract, Final, Inline | Transparent,
436+
commonFlags(Private, Protected, Abstract, Final, Inline,
440437
Sealed, Case, Implicit, Override, AbsOverride, Lazy, JavaStatic, Erased)
441438

442439
/** Flags representing modifiers that can appear in trees */
@@ -457,7 +454,7 @@ object Flags {
457454
Scala2ExistentialCommon | Mutable.toCommonFlags | Touched | JavaStatic |
458455
CovariantOrOuter | ContravariantOrLabel | CaseAccessor.toCommonFlags |
459456
NonMember | ImplicitCommon | Permanent | Synthetic |
460-
SuperAccessorOrScala2x | Inline | Transparent
457+
SuperAccessorOrScala2x | Inline
461458

462459
/** Flags that are not (re)set when completing the denotation, or, if symbol is
463460
* a top-level class or object, when completing the denotation once the class
@@ -551,26 +548,23 @@ object Flags {
551548
/** Assumed to be pure */
552549
final val StableOrErased = Stable | Erased
553550

554-
/** Labeled `private`, `final`, `inline` or `transparent` */
555-
final val EffectivelyFinal = Private | Final | Inline | Transparent
551+
/** Labeled `private`, `final`, or `inline` */
552+
final val EffectivelyFinal = Private | Final | Inline
556553

557554
/** A private method */
558555
final val PrivateMethod = allOf(Private, Method)
559556

560557
/** A private accessor */
561558
final val PrivateAccessor = allOf(Private, Accessor)
562559

563-
/** A transparent method */
564-
final val TransparentMethod = allOf(Transparent, Method)
565-
566560
/** An inline method */
567561
final val InlineMethod = allOf(Inline, Method)
568562

569563
/** An implicit inline method */
570564
final val ImplicitInlineMethod = allOf(Inline, Implicit, Method)
571565

572-
/** A transparent parameter */
573-
final val TransparentParam = allOf(Transparent, Param)
566+
/** An inline parameter */
567+
final val InlineParam = allOf(Inline, Param)
574568

575569
/** An enum case */
576570
final val EnumCase = allOf(Enum, Case)
@@ -596,8 +590,8 @@ object Flags {
596590
/** A deferred type member or parameter (these don't have right hand sides) */
597591
final val DeferredOrTypeParam = Deferred | TypeParam
598592

599-
/** value that's final or transparent */
600-
final val FinalOrTransparent = Final | Transparent
593+
/** value that's final or inline */
594+
final val FinalOrInline = Final | Inline
601595

602596
/** A covariant type parameter instance */
603597
final val LocalCovariant = allOf(Local, Covariant)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ object Mode {
9595
/** We are in the IDE */
9696
val Interactive = newMode(20, "Interactive")
9797

98-
/** We are typing the body of a transparent or inline method */
98+
/** We are typing the body of an inline method */
9999
val InlineableBody = newMode(21, "InlineableBody")
100100

101101
/** Read comments from definitions when unpickling from TASTY */

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -779,16 +779,9 @@ object SymDenotations {
779779

780780
def isSkolem: Boolean = name == nme.SKOLEM
781781

782-
def isTransparentMethod(implicit ctx: Context): Boolean =
783-
is(TransparentMethod, butNot = AccessorOrSynthetic)
784-
785782
def isInlineMethod(implicit ctx: Context): Boolean =
786783
is(InlineMethod, butNot = AccessorOrSynthetic)
787784

788-
/** A transparent or inline method */
789-
def isInlineable(implicit ctx: Context): Boolean =
790-
is(TransparentMethod) || is(InlineMethod)
791-
792785
/** An erased value or an inline method, excluding @forceInline annotated methods.
793786
* The latter have to be kept around to get to parity with Scala.
794787
* This is necessary at least until we have full bootstrap. Right now

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3031,18 +3031,18 @@ object Types {
30313031
abstract class MethodTypeCompanion extends TermLambdaCompanion[MethodType] { self =>
30323032

30333033
/** Produce method type from parameter symbols, with special mappings for repeated
3034-
* and transparent parameters:
3034+
* and inline parameters:
30353035
* - replace @repeated annotations on Seq or Array types by <repeated> types
3036-
* - add @inlineParam to transparent call-by-value parameters
3036+
* - add @inlineParam to inline call-by-value parameters
30373037
*/
30383038
def fromSymbols(params: List[Symbol], resultType: Type)(implicit ctx: Context) = {
3039-
def translateTransparent(tp: Type): Type = tp match {
3039+
def translateInline(tp: Type): Type = tp match {
30403040
case _: ExprType => tp
3041-
case _ => AnnotatedType(tp, Annotation(defn.TransparentParamAnnot))
3041+
case _ => AnnotatedType(tp, Annotation(defn.InlineParamAnnot))
30423042
}
30433043
def paramInfo(param: Symbol) = {
30443044
val paramType = param.info.annotatedToRepeated
3045-
if (param.is(Transparent)) translateTransparent(paramType) else paramType
3045+
if (param.is(Inline)) translateInline(paramType) else paramType
30463046
}
30473047

30483048
apply(params.map(_.name.asTermName))(

compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ Standard-Section: "ASTs" TopLevelStat*
183183
ERASED
184184
LAZY
185185
OVERRIDE
186-
TRANSPARENT
187186
INLINE
188187
MACRO // inline method containing toplevel splices
189188
STATIC // mapped to static Java member
@@ -299,7 +298,7 @@ object TastyFormat {
299298
final val IMPLICIT = 13
300299
final val LAZY = 14
301300
final val OVERRIDE = 15
302-
final val TRANSPARENT = 16
301+
303302
final val INLINE = 17
304303
final val STATIC = 18
305304
final val OBJECT = 19
@@ -481,7 +480,6 @@ object TastyFormat {
481480
| ERASED
482481
| LAZY
483482
| OVERRIDE
484-
| TRANSPARENT
485483
| INLINE
486484
| MACRO
487485
| STATIC
@@ -539,7 +537,6 @@ object TastyFormat {
539537
case ERASED => "ERASED"
540538
case LAZY => "LAZY"
541539
case OVERRIDE => "OVERRIDE"
542-
case TRANSPARENT => "TRANSPARENT"
543540
case INLINE => "INLINE"
544541
case MACRO => "MACRO"
545542
case STATIC => "STATIC"

0 commit comments

Comments
 (0)