aboutsummaryrefslogblamecommitdiff
path: root/test/test/DottyTest.scala
blob: 28bc59b2820f7ecfc09ed7effd3238df9ba33a74 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                         

                                                          




                                   
                                 
                                      
                                  



                                      
                                  







                                                                                     
package test

import dotty.tools.dotc.core._
import dotty.tools.dotc.core.Contexts._
import dotty.tools.dotc.core.Symbols._
import dotty.tools.dotc.core.Flags._
import Types._, Symbols._, Decorators._
import dotty.tools.dotc.util.Texts._
import dotty.tools.dotc.core.Decorators._
import org.junit.Test

class DottyTest {

  dotty.tools.dotc.parsing.Scanners // initialize keywords

  implicit val ctx: Context = {
    val base = Context.theBase
    import base.settings._
    val ctx = base.initialCtx.fresh
      .withSetting(verbose, true)
//      .withSetting(debug, true)
//      .withSetting(debugTrace, true)
//      .withSetting(prompt, true)
      .withSetting(Ylogcp, true)
      .withSetting(printtypes, true)
      .withSetting(pageWidth, 90)
      .withSetting(log, List("<some"))
//      .withSetting(uniqid, true)
    println(ctx.settings)
    base.definitions.init()
    ctx
  }

  def methType(names: String*)(paramTypes: Type*)(resultType: Type = defn.UnitType) =
    MethodType(names.toList map (_.toTermName), paramTypes.toList, resultType)
}