Skip to content

Commit eec815a

Browse files
committed
Micro-optimization: Streamline SymDenotation#info
1 parent 432ceac commit eec815a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,11 @@ object SymDenotations {
202202
* The info is an instance of TypeType iff this is a type denotation
203203
* Uncompleted denotations set myInfo to a LazyType.
204204
*/
205-
final def info(implicit ctx: Context): Type = myInfo match {
206-
case myInfo: LazyType => completeFrom(myInfo); info
207-
case _ => myInfo
205+
final def info(implicit ctx: Context): Type = {
206+
def completeInfo = {
207+
completeFrom(myInfo.asInstanceOf[LazyType]); info
208+
}
209+
if (myInfo.isInstanceOf[LazyType]) completeInfo else myInfo
208210
}
209211

210212
/** The type info, or, if symbol is not yet completed, the completer */

0 commit comments

Comments
 (0)