aboutsummaryrefslogblamecommitdiff
path: root/src/dotty/tools/dotc/transform/TypeUtils.scala
blob: d07930661354fc1152406dbe98c6f9a90caf710d (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12


                        








                                             


                                                                           
 


                                                              
                                                                     

                                                
 






                                                            
package dotty.tools.dotc
package transform

import core._
import core.transform.Erasure.ErasedValueType
import Types._
import Contexts._
import Symbols._
import Decorators._
import StdNames.nme
import NameOps._
import language.implicitConversions

object TypeUtils {
  implicit def decorateTypeUtils(tpe: Type): TypeUtils = new TypeUtils(tpe)

}

/** A decorator that provides methods for type transformations
 *  that are needed in the transofmer pipeline (not needed right now)
 */
class TypeUtils(val self: Type) extends AnyVal {

  def isErasedValueType(implicit ctx: Context): Boolean =
    self.isInstanceOf[ErasedValueType]

  def isPrimitiveValueType(implicit ctx: Context): Boolean =
    self.classSymbol.isPrimitiveValueClass

 }