Skip to content

A symmetric meta programming framework #3634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 62 commits into from
Dec 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
85fa627
Fix #3597 - Don't check inline for params after pickling
odersky Dec 2, 2017
63d02a6
Fix condition in expandPrivate
odersky Dec 3, 2017
f93368d
Fix #3596: Handle supercall arguments in unpickler
odersky Dec 3, 2017
36ede6f
When unpickling, enter only class members into enclosing scope.
odersky Dec 3, 2017
bebefec
Clean up treatment of local contexts in unpickler
odersky Dec 3, 2017
227f8be
Drop localDummies again
odersky Dec 3, 2017
02eebc2
Add prefix types
odersky Dec 4, 2017
7303898
Cleanup of ElimJavaPackages
odersky Dec 4, 2017
141acaa
Rename ElimJavaPackages -> ElimPackagePrefixes
odersky Dec 4, 2017
6a9c027
Initial meta framework classes and modules
odersky Dec 4, 2017
e52fe74
Utility method: reporting
odersky Dec 5, 2017
a5134ca
Add quote syntax
odersky Dec 5, 2017
f3ff4e9
Add quote typechecking
odersky Dec 5, 2017
b21e638
Add quote reification framework
odersky Dec 5, 2017
7418cef
Support printing of Quote trees
odersky Dec 5, 2017
67a808a
Fix isType/isTerm predicates for splices
odersky Dec 5, 2017
a53c2ff
Fix missing core libs test
odersky Dec 5, 2017
1a7803c
Change reify for types
odersky Dec 5, 2017
72c32c5
Rename reify -> unpickle
odersky Dec 5, 2017
b35ff5f
Make ReifyQuotes a macro phase
odersky Dec 5, 2017
0e0f31d
Don't force quote methods
odersky Dec 5, 2017
1bdf8a0
Remove outdated comment
odersky Dec 5, 2017
87ee12f
Make '( and '{ tokens that can start an expression
odersky Dec 6, 2017
4fb2eb0
Revamp of ReifyQuotes
odersky Dec 6, 2017
1134507
Rename meta -> quoted
odersky Dec 6, 2017
d87db6c
Suppress some staging level errors
odersky Dec 6, 2017
dedf671
Remove printing inefficiencies
odersky Dec 8, 2017
bc6c690
Pull inlined bindings under a splice
odersky Dec 8, 2017
f2c09d4
Inline by-name parameters directly
odersky Dec 8, 2017
db7e42a
Add test case
odersky Dec 8, 2017
a9c3b5f
Fix layout of implicit error messages
odersky Dec 11, 2017
90acfed
Polishings to TreePickler
odersky Dec 11, 2017
205b4cd
Add MacroTransform that allows implicit search
odersky Dec 11, 2017
b466e0a
Allow cross-stage persistence for types
odersky Dec 11, 2017
22d7429
Add Quotable type class
odersky Dec 13, 2017
dbb7c81
Add Let to staged interpreter test
odersky Dec 13, 2017
300c37e
Don't require implicits to make type refs persist stages
odersky Dec 14, 2017
646453a
Add infrastructure for pickling/unpickling with holes and splices
odersky Dec 14, 2017
376d325
Print TypeDefs from trees
odersky Dec 16, 2017
a1bff5f
Make TreeTypeMap non-final
odersky Dec 16, 2017
6a252e0
Move Unpickler to runtime.quoted
odersky Dec 16, 2017
bc6dde8
Export more printing methods from Printer
odersky Dec 16, 2017
d8dd739
Add Lambda method to tpd
odersky Dec 16, 2017
1d52ab7
ReifyQuotes v2
odersky Dec 16, 2017
a8b9ba7
Mark inline methods containing splices as macros
odersky Dec 16, 2017
4023502
Eliminate macros in RefChecks
odersky Dec 16, 2017
d1abf40
Typecheck macros as if they were in a quoted context
odersky Dec 17, 2017
04d3a58
Refine handling of inline parameters of macros
odersky Dec 17, 2017
94e7c83
Force definitions of quote methods when initializing Definitions
odersky Dec 19, 2017
2e3c56b
Syntax polishing
odersky Dec 19, 2017
0c6cbc3
Rename Quotable -> Liftable
odersky Dec 19, 2017
b90ed13
Add reference documentation
odersky Dec 19, 2017
21ad0db
Fix test
odersky Dec 19, 2017
b0437ce
Fix syntax highlighting in docs
odersky Dec 19, 2017
5fe6d15
Doecumentation fixes
odersky Dec 19, 2017
07bbb2b
More doc fixes
odersky Dec 19, 2017
8656be3
Add section "Limitations to Splicing"
odersky Dec 19, 2017
833775f
Address review comments on reference section
odersky Dec 19, 2017
33a93a6
Use different names for quote and type quote methods
odersky Dec 20, 2017
39ea6fb
Set Macro flag and containsQuotesOrSplices in PostTyper
odersky Dec 20, 2017
aa252fc
Reorder printers alphabetically
odersky Dec 20, 2017
8f048a7
Add test to pending
odersky Dec 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions compiler/src/dotty/tools/dotc/CompilationUnit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ class CompilationUnit(val source: SourceFile) {

/** Pickled TASTY binaries, indexed by class. */
var pickled: Map[ClassSymbol, Array[Byte]] = Map()

/** Will be reset to `true` if `untpdTree` contains `Quote` trees. The information
* is used in phase ReifyQuotes in order to avoid traversing a quote-less tree.
*/
var containsQuotesOrSplices: Boolean = false
}

object CompilationUnit {
Expand Down
9 changes: 5 additions & 4 deletions compiler/src/dotty/tools/dotc/Compiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ class Compiler {
List(new sbt.ExtractAPI), // Sends a representation of the API of classes to sbt via callbacks
List(new Pickler), // Generate TASTY info
List(new LinkAll), // Reload compilation units from TASTY for library code (if needed)
List(new ReifyQuotes), // Turn quoted trees into explicit run-time data structures
List(new FirstTransform, // Some transformations to put trees into a canonical form
new CheckReentrant, // Internal use only: Check that compiled program has no data races involving global vars
new ElimJavaPackages), // Eliminate syntactic references to Java packages
new ElimPackagePrefixes), // Eliminate references to package prefixes in Select nodes
List(new CheckStatic, // Check restrictions that apply to @static members
new ElimRepeated, // Rewrite vararg parameters and arguments
new NormalizeFlags, // Rewrite some definition flags
Expand All @@ -59,16 +60,16 @@ class Compiler {
new ByNameClosures, // Expand arguments to by-name parameters to closures
new LiftTry, // Put try expressions that might execute on non-empty stacks into their own methods
new HoistSuperArgs, // Hoist complex arguments of supercalls to enclosing scope
new ClassOf, // Expand `Predef.classOf` calls.
new RefChecks), // Various checks mostly related to abstract members and overriding
new ClassOf, // Expand `Predef.classOf` calls.
new RefChecks), // Various checks mostly related to abstract members and overriding
List(new TryCatchPatterns, // Compile cases in try/catch
new PatternMatcher, // Compile pattern matches
new ExplicitOuter, // Add accessors to outer classes from nested ones.
new ExplicitSelf, // Make references to non-trivial self types explicit as casts
new ShortcutImplicits, // Allow implicit functions without creating closures
new CrossCastAnd, // Normalize selections involving intersection types.
new Splitter), // Expand selections involving union types into conditionals
List(new PhantomArgLift, // Extracts the evaluation of phantom arguments placing them before the call.
List(new PhantomArgLift, // Extracts the evaluation of phantom arguments placing them before the call.
new VCInlineMethods, // Inlines calls to value class methods
new SeqLiterals, // Express vararg arguments as arrays
new InterceptedMethods, // Special handling of `==`, `|=`, `getClass` methods
Expand Down
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/ast/Desugar.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,8 @@ object desugar {
Select(t, op.name)
}
case PrefixOp(op, t) =>
Select(t, nme.UNARY_PREFIX ++ op.name)
val nspace = if (ctx.mode.is(Mode.Type)) tpnme else nme
Select(t, nspace.UNARY_PREFIX ++ op.name)
case Tuple(ts) =>
val arity = ts.length
def tupleTypeRef = defn.TupleType(arity)
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/ast/TreeInfo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ trait UntypedTreeInfo extends TreeInfo[Untyped] { self: Trees.Instance[Untyped]
*/
def lacksDefinition(mdef: MemberDef)(implicit ctx: Context) = mdef match {
case mdef: ValOrDefDef =>
mdef.unforcedRhs == EmptyTree && !mdef.name.isConstructorName && !mdef.mods.is(ParamAccessor)
mdef.unforcedRhs == EmptyTree && !mdef.name.isConstructorName && !mdef.mods.is(TermParamOrAccessor)
case mdef: TypeDef =>
def isBounds(rhs: Tree): Boolean = rhs match {
case _: TypeBoundsTree => true
Expand Down
14 changes: 12 additions & 2 deletions compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import dotty.tools.dotc.transform.SymUtils._
* gets two different denotations in the same period. Hence, if -Yno-double-bindings is
* set, we would get a data race assertion error.
*/
final class TreeTypeMap(
class TreeTypeMap(
val typeMap: Type => Type = IdentityTypeMap,
val treeMap: tpd.Tree => tpd.Tree = identity _,
val oldOwners: List[Symbol] = Nil,
Expand Down Expand Up @@ -154,7 +154,7 @@ final class TreeTypeMap(
assert(!to.exists(substFrom contains _))
assert(!from.exists(newOwners contains _))
assert(!to.exists(oldOwners contains _))
new TreeTypeMap(
newMap(
typeMap,
treeMap,
from ++ oldOwners,
Expand All @@ -163,6 +163,16 @@ final class TreeTypeMap(
to ++ substTo)
}

/** A new map of the same class this one */
protected def newMap(
typeMap: Type => Type,
treeMap: Tree => Tree,
oldOwners: List[Symbol],
newOwners: List[Symbol],
substFrom: List[Symbol],
substTo: List[Symbol])(implicit ctx: Context) =
new TreeTypeMap(typeMap, treeMap, oldOwners, newOwners, substFrom, substTo)

/** Apply `typeMap` and `ownerMap` to given symbols `syms`
* and return a treemap that contains the substitution
* between original and mapped symbols.
Expand Down
6 changes: 6 additions & 0 deletions compiler/src/dotty/tools/dotc/ast/tpd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
Closure(Nil, call, targetTpt))
}

/** A closure whole anonymous function has the given method type */
def Lambda(tpe: MethodType, rhsFn: List[Tree] => Tree)(implicit ctx: Context): Block = {
val meth = ctx.newSymbol(ctx.owner, nme.ANON_FUN, Synthetic | Method, tpe)
Closure(meth, tss => rhsFn(tss.head).changeOwner(ctx.owner, meth))
}

def CaseDef(pat: Tree, guard: Tree, body: Tree)(implicit ctx: Context): CaseDef =
ta.assignType(untpd.CaseDef(pat, guard, body), body)

Expand Down
14 changes: 13 additions & 1 deletion compiler/src/dotty/tools/dotc/ast/untpd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {

case class InfixOp(left: Tree, op: Ident, right: Tree) extends OpTree
case class PostfixOp(od: Tree, op: Ident) extends OpTree
case class PrefixOp(op: Ident, od: Tree) extends OpTree
case class PrefixOp(op: Ident, od: Tree) extends OpTree {
override def isType = op.isType
override def isTerm = op.isTerm
}
case class Parens(t: Tree) extends ProxyTree {
def forwardTo = t
}
Expand All @@ -78,6 +81,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
override def isType = !isTerm
}
case class Throw(expr: Tree) extends TermTree
case class Quote(expr: Tree) extends TermTree
case class WhileDo(cond: Tree, body: Tree) extends TermTree
case class DoWhile(body: Tree, cond: Tree) extends TermTree
case class ForYield(enums: List[Tree], expr: Tree) extends TermTree
Expand Down Expand Up @@ -449,6 +453,10 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
case tree: Throw if expr eq tree.expr => tree
case _ => finalize(tree, untpd.Throw(expr))
}
def Quote(tree: Tree)(expr: Tree) = tree match {
case tree: Quote if expr eq tree.expr => tree
case _ => finalize(tree, untpd.Quote(expr))
}
def WhileDo(tree: Tree)(cond: Tree, body: Tree) = tree match {
case tree: WhileDo if (cond eq tree.cond) && (body eq tree.body) => tree
case _ => finalize(tree, untpd.WhileDo(cond, body))
Expand Down Expand Up @@ -507,6 +515,8 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
cpy.Tuple(tree)(transform(trees))
case Throw(expr) =>
cpy.Throw(tree)(transform(expr))
case Quote(expr) =>
cpy.Quote(tree)(transform(expr))
case WhileDo(cond, body) =>
cpy.WhileDo(tree)(transform(cond), transform(body))
case DoWhile(body, cond) =>
Expand Down Expand Up @@ -554,6 +564,8 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
this(x, trees)
case Throw(expr) =>
this(x, expr)
case Quote(expr) =>
this(x, expr)
case WhileDo(cond, body) =>
this(this(x, cond), body)
case DoWhile(body, cond) =>
Expand Down
31 changes: 16 additions & 15 deletions compiler/src/dotty/tools/dotc/config/Printers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,27 @@ object Printers {
}

val default: Printer = new Printer
val dottydoc: Printer = noPrinter
val core: Printer = noPrinter
val typr: Printer = noPrinter

val constr: Printer = noPrinter
val core: Printer = noPrinter
val checks: Printer = noPrinter
val overload: Printer = noPrinter
val implicits: Printer = noPrinter
val implicitsDetailed: Printer = noPrinter
val subtyping: Printer = noPrinter
val unapp: Printer = noPrinter
val gadts: Printer = noPrinter
val hk: Printer = noPrinter
val variances: Printer = noPrinter
val incremental: Printer = noPrinter
val config: Printer = noPrinter
val transforms: Printer = noPrinter
val cyclicErrors: Printer = noPrinter
val pickling: Printer = noPrinter
val inlining: Printer = noPrinter
val dottydoc: Printer = noPrinter
val exhaustivity: Printer = noPrinter
val incremental: Printer = noPrinter
val gadts: Printer = noPrinter
val hk: Printer = noPrinter
val implicits: Printer = noPrinter
val implicitsDetailed: Printer = noPrinter
val inlining: Printer = noPrinter
val overload: Printer = noPrinter
val patmatch: Printer = noPrinter
val pickling: Printer = noPrinter
val simplify: Printer = noPrinter
val subtyping: Printer = noPrinter
val transforms: Printer = noPrinter
val typr: Printer = noPrinter
val unapp: Printer = noPrinter
val variances: Printer = noPrinter
}
9 changes: 9 additions & 0 deletions compiler/src/dotty/tools/dotc/core/Contexts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,15 @@ object Contexts {
else if (untpd.isSuperConstrCall(stat) && this.owner.isClass) superCallContext
else ctx.fresh.setOwner(exprOwner)

/** A new context that summarizes an import statement */
def importContext(imp: Import[_], sym: Symbol) = {
val impNameOpt = imp.expr match {
case ref: RefTree[_] => Some(ref.name.asTermName)
case _ => None
}
ctx.fresh.setImportInfo(new ImportInfo(implicit ctx => sym, imp.selectors, impNameOpt))
}

/** The current source file; will be derived from current
* compilation unit.
*/
Expand Down
4 changes: 4 additions & 0 deletions compiler/src/dotty/tools/dotc/core/Decorators.scala
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ object Decorators {
recur(enclosingInlineds, pos)
}

implicit class reportingDeco[T](val x: T) extends AnyVal {
def reporting(op: T => String): T = { println(op(x)); x }
}

implicit class StringInterpolators(val sc: StringContext) extends AnyVal {

/** General purpose string formatting */
Expand Down
53 changes: 43 additions & 10 deletions compiler/src/dotty/tools/dotc/core/Definitions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package core
import Types._, Contexts._, Symbols._, Denotations._, SymDenotations._, StdNames._, Names._
import Flags._, Scopes._, Decorators._, NameOps._, util.Positions._, Periods._
import unpickleScala2.Scala2Unpickler.ensureConstructor
import scala.annotation.{ switch, meta }
import scala.collection.{ mutable, immutable }
import PartialFunction._
import collection.mutable
Expand Down Expand Up @@ -146,11 +145,20 @@ class Definitions {
}

private def enterPolyMethod(cls: ClassSymbol, name: TermName, typeParamCount: Int,
resultTypeFn: PolyType => Type, flags: FlagSet = EmptyFlags) = {
resultTypeFn: PolyType => Type, flags: FlagSet = EmptyFlags,
useCompleter: Boolean = false) = {
val tparamNames = PolyType.syntheticParamNames(typeParamCount)
val tparamInfos = tparamNames map (_ => TypeBounds.empty)
val ptype = PolyType(tparamNames)(_ => tparamInfos, resultTypeFn)
enterMethod(cls, name, ptype, flags)
def ptype = PolyType(tparamNames)(_ => tparamInfos, resultTypeFn)
val info =
if (useCompleter)
new LazyType {
def complete(denot: SymDenotation)(implicit ctx: Context): Unit = {
denot.info = ptype
}
}
else ptype
enterMethod(cls, name, info, flags)
}

private def enterT1ParameterlessMethod(cls: ClassSymbol, name: TermName, resultTypeFn: PolyType => Type, flags: FlagSet) =
Expand Down Expand Up @@ -290,14 +298,23 @@ class Definitions {
/** Marker method to indicate an argument to a call-by-name parameter.
* Created by byNameClosures and elimByName, eliminated by Erasure,
*/
lazy val cbnArg = enterPolyMethod(
OpsPackageClass, nme.cbnArg, 1,
lazy val cbnArg = enterPolyMethod(OpsPackageClass, nme.cbnArg, 1,
pt => MethodType(List(FunctionOf(Nil, pt.paramRefs(0))), pt.paramRefs(0)))

/** Method representing a throw */
lazy val throwMethod = enterMethod(OpsPackageClass, nme.THROWkw,
MethodType(List(ThrowableType), NothingType))

/** Method representing a term quote */
lazy val quoteMethod = enterPolyMethod(OpsPackageClass, nme.QUOTE, 1,
pt => MethodType(pt.paramRefs(0) :: Nil, QuotedExprType.appliedTo(pt.paramRefs(0) :: Nil)),
useCompleter = true)

/** Method representing a type quote */
lazy val typeQuoteMethod = enterPolyMethod(OpsPackageClass, nme.TYPE_QUOTE, 1,
pt => QuotedTypeType.appliedTo(pt.paramRefs(0) :: Nil),
useCompleter = true)

lazy val NothingClass: ClassSymbol = enterCompleteClassSymbol(
ScalaPackageClass, tpnme.Nothing, AbstractFinal, List(AnyClass.typeRef))
def NothingType = NothingClass.typeRef
Expand Down Expand Up @@ -585,6 +602,21 @@ class Definitions {
def ClassTagClass(implicit ctx: Context) = ClassTagType.symbol.asClass
def ClassTagModule(implicit ctx: Context) = ClassTagClass.companionModule

lazy val QuotedExprType = ctx.requiredClassRef("scala.quoted.Expr")
def QuotedExprClass(implicit ctx: Context) = QuotedExprType.symbol.asClass

def QuotedExpr_~(implicit ctx: Context) = QuotedExprClass.requiredMethod(nme.UNARY_~)
def QuotedExpr_run(implicit ctx: Context) = QuotedExprClass.requiredMethod(nme.run)

lazy val QuotedTypeType = ctx.requiredClassRef("scala.quoted.Type")
def QuotedTypeClass(implicit ctx: Context) = QuotedTypeType.symbol.asClass

def QuotedType_~(implicit ctx: Context) =
QuotedTypeClass.info.member(tpnme.UNARY_~).symbol.asType

def Unpickler_unpickleExpr = ctx.requiredMethod("scala.runtime.quoted.Unpickler.unpickleExpr")
def Unpickler_unpickleType = ctx.requiredMethod("scala.runtime.quoted.Unpickler.unpickleType")

lazy val EqType = ctx.requiredClassRef("scala.Eq")
def EqClass(implicit ctx: Context) = EqType.symbol.asClass
def EqModule(implicit ctx: Context) = EqClass.companionModule
Expand Down Expand Up @@ -1071,7 +1103,8 @@ class Definitions {
OpsPackageClass)

/** Lists core methods that don't have underlying bytecode, but are synthesized on-the-fly in every reflection universe */
lazy val syntheticCoreMethods = AnyMethods ++ ObjectMethods ++ List(String_+, throwMethod)
lazy val syntheticCoreMethods =
AnyMethods ++ ObjectMethods ++ List(String_+, throwMethod, quoteMethod, typeQuoteMethod)

lazy val reservedScalaClassNames: Set[Name] = syntheticScalaClasses.map(_.name).toSet

Expand All @@ -1081,13 +1114,13 @@ class Definitions {
def init()(implicit ctx: Context) = {
this.ctx = ctx
if (!_isInitialized) {
// force initialization of every symbol that is synthesized or hijacked by the compiler
val forced = syntheticCoreClasses ++ syntheticCoreMethods ++ ScalaValueClasses()

// Enter all symbols from the scalaShadowing package in the scala package
for (m <- ScalaShadowingPackageClass.info.decls)
ScalaPackageClass.enter(m)

// force initialization of every symbol that is synthesized or hijacked by the compiler
val forced = syntheticCoreClasses ++ syntheticCoreMethods ++ ScalaValueClasses()

_isInitialized = true
}
}
Expand Down
7 changes: 5 additions & 2 deletions compiler/src/dotty/tools/dotc/core/Flags.scala
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ object Flags {
/** A Scala 2.12 or higher trait */
final val Scala_2_12_Trait = typeFlag(58, "<scala_2_12_trait>")

/** A macro (Scala 2.x only) */
/** A macro */
final val Macro = commonFlag(59, "<macro>")

/** A method that is known to have inherited default parameters */
Expand Down Expand Up @@ -575,7 +575,7 @@ object Flags {
final val SyntheticOrPrivate = Synthetic | Private

/** A deferred member or a parameter accessor (these don't have right hand sides) */
final val DeferredOrParamAccessor = Deferred | ParamAccessor
final val DeferredOrParamOrAccessor = Deferred | Param | ParamAccessor

/** value that's final or inline */
final val FinalOrInline = Final | Inline
Expand All @@ -598,6 +598,9 @@ object Flags {
/** Is a default parameter in Scala 2*/
final val DefaultParameter = allOf(Param, DefaultParameterized)

/** A Scala 2 Macro */
final val Scala2Macro = allOf(Macro, Scala2x)

/** A trait that does not need to be initialized */
final val NoInitsTrait = allOf(Trait, NoInits)

Expand Down
4 changes: 4 additions & 0 deletions compiler/src/dotty/tools/dotc/core/Phases.scala
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ object Phases {
* and type applications.
*/
def relaxedTyping: Boolean = false

/** If set, implicit search is enabled */
def allowsImplicitSearch: Boolean = false

/** List of names of phases that should precede this phase */
def runsAfter: Set[Class[_ <: Phase]] = Set.empty

Expand Down
3 changes: 3 additions & 0 deletions compiler/src/dotty/tools/dotc/core/StdNames.scala
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ object StdNames {
val INITIALIZER_PREFIX: N = "initial$"
val COMPANION_MODULE_METHOD: N = "companion$module"
val COMPANION_CLASS_METHOD: N = "companion$class"
val QUOTE: N = "'"
val TYPE_QUOTE: N = "type_'"
val TRAIT_SETTER_SEPARATOR: N = str.TRAIT_SETTER_SEPARATOR

// value types (and AnyRef) are all used as terms as well
Expand Down Expand Up @@ -484,6 +486,7 @@ object StdNames {
val reflect : N = "reflect"
val reify : N = "reify"
val rootMirror : N = "rootMirror"
val run: N = "run"
val runOrElse: N = "runOrElse"
val runtime: N = "runtime"
val runtimeClass: N = "runtimeClass"
Expand Down
Loading