mercredi 8 novembre 2017

How to get the aliased type of a type alias in scala runtime?

import scala.reflect.runtime.universe._

object Main {

  final type INeedDetails = (Int, String, Unit, Nothing, Float)

  def main(args: Array[String]): Unit = println {
    typeTag[INeedDetails]
  }

}

The snippet above will prnint TypeTag[Main.INeedDetails]. Is there any way to extract the complete (Int, String, Unit, Nothing, Float) tuple information from this TypeTag?





Aucun commentaire:

Enregistrer un commentaire