File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ object Trees {
174174 def toList : List [Tree [T ]] = this :: Nil
175175
176176 /** if this tree is the empty tree, the alternative, else this tree */
177- def orElse [U >: Untyped <: T ](that : => Tree [U ]): Tree [U ] =
177+ inline def orElse [U >: Untyped <: T ](inline that : Tree [U ]): Tree [U ] =
178178 if (this eq genericEmptyTree) that else this
179179
180180 /** The number of nodes in this tree */
Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ object Denotations {
237237 def mapInfo (f : Type => Type )(using Context ): Denotation
238238
239239 /** If this denotation does not exist, fallback to alternative */
240- final def orElse (that : => Denotation ): Denotation = if (this .exists) this else that
240+ inline def orElse (inline that : Denotation ): Denotation = if (this .exists) this else that
241241
242242 /** The set of alternative single-denotations making up this denotation */
243243 final def alternatives : List [SingleDenotation ] = altsWith(alwaysTrue)
@@ -596,7 +596,7 @@ object Denotations {
596596 def mapInfo (f : Type => Type )(using Context ): SingleDenotation =
597597 derivedSingleDenotation(symbol, f(info))
598598
599- def orElse (that : => SingleDenotation ): SingleDenotation = if (this .exists) this else that
599+ inline def orElse (inline that : SingleDenotation ): SingleDenotation = if (this .exists) this else that
600600
601601 def altsWith (p : Symbol => Boolean ): List [SingleDenotation ] =
602602 if (exists && p(symbol)) this :: Nil else Nil
Original file line number Diff line number Diff line change @@ -239,7 +239,7 @@ object Symbols {
239239 }
240240
241241 /** This symbol, if it exists, otherwise the result of evaluating `that` */
242- def orElse (that : => Symbol )(using Context ): Symbol =
242+ inline def orElse (inline that : Symbol )(using Context ): Symbol =
243243 if (this .exists) this else that
244244
245245 /** If this symbol satisfies predicate `p` this symbol, otherwise `NoSymbol` */
You can’t perform that action at this time.
0 commit comments