Skip to content

Fix/528 compile predef #531

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 3 commits into from
May 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 3 additions & 2 deletions src/dotty/DottyPredef.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package dotty

import scala.reflect.ClassTag
import scala.reflect.runtime.universe.TypeTag
import scala.Predef.??? // this is currently ineffective, because of #530

object DottyPredef {
/** implicits for ClassTag and TypeTag. Should be implemented with macros */
implicit def classTag[T]: ClassTag[T] = ???
implicit def typeTag[T]: TypeTag[T] = ???
implicit def classTag[T]: ClassTag[T] = scala.Predef.???
implicit def typeTag[T]: TypeTag[T] = scala.Predef.???
}
4 changes: 3 additions & 1 deletion src/dotty/tools/dotc/Compiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ class Compiler {
.setMode(Mode.ImplicitsEnabled)
.setTyperState(new MutableTyperState(ctx.typerState, new ConsoleReporter()(ctx), isCommittable = true))
ctx.definitions.init(start) // set context of definitions to start
start.setRunInfo(new RunInfo(start))
def addImport(ctx: Context, sym: Symbol) =
ctx.fresh.setImportInfo(ImportInfo.rootImport(sym)(ctx))
(start.setRunInfo(new RunInfo(start)) /: defn.RootImports)(addImport)
if (ctx.settings.YnoImports.value) start
else (start /: defn.RootImports)(addImport)
}

def reset()(implicit ctx: Context): Unit = {
Expand Down
2 changes: 1 addition & 1 deletion src/dotty/tools/dotc/config/ScalaSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class ScalaSettings extends Settings.SettingGroup {
val log = PhasesSetting("-Ylog", "Log operations during")
val Ylogcp = BooleanSetting("-Ylog-classpath", "Output information about what classpath is being applied.")
val Ynogenericsig = BooleanSetting("-Yno-generic-signatures", "Suppress generation of generic signatures for Java.")
val noimports = BooleanSetting("-Yno-imports", "Compile without importing scala.*, java.lang.*, or Predef.")
val YnoImports = BooleanSetting("-Yno-imports", "Compile without importing scala.*, java.lang.*, or Predef.")
val nopredef = BooleanSetting("-Yno-predef", "Compile without importing Predef.")
val noAdaptedArgs = BooleanSetting("-Yno-adapted-args", "Do not adapt an argument list (either by inserting () or creating a tuple) to match the receiver.")
val selfInAnnots = BooleanSetting("-Yself-in-annots", "Include a \"self\" identifier inside of annotations.")
Expand Down
8 changes: 8 additions & 0 deletions tests/disabled/i530-import-symbolic.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
object P {
def !#@ : Nothing = ???
}

object Test {
import P.!#@
def f = !#@
}