Skip to content

Update reference compiler #9606

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 2 commits into from
Aug 20, 2020
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
10 changes: 5 additions & 5 deletions compiler/src/dotty/tools/dotc/ast/Trees.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1379,11 +1379,11 @@ object Trees {
// Ties the knot of the traversal: call `foldOver(x, tree))` to dive in the `tree` node.
def apply(x: X, tree: Tree)(using Context): X

def apply(x: X, trees: List[Tree])(using Context): X = trees match
case tree :: rest =>
apply(apply(x, tree), rest)
case Nil =>
x
def apply(x: X, trees: List[Tree])(using Context): X =
def fold(x: X, trees: List[Tree]): X = trees match
case tree :: rest => fold(apply(x, tree), rest)
case Nil => x
fold(x, trees)

def foldOver(x: X, tree: Tree)(using Context): X =
if (tree.source != ctx.source && tree.source.exists)
Expand Down
1 change: 0 additions & 1 deletion library/src-non-bootstrapped/scala/Enum.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ trait Enum extends Product, Serializable:

/** A number uniquely identifying a case of an enum */
def ordinal: Int
protected def $ordinal: Int
45 changes: 0 additions & 45 deletions library/src-non-bootstrapped/scala/implicits/Not.scala

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,6 @@ object CompileTime {
@compileTimeOnly("Illegal reference to `scala.internal.quoted.CompileTime.exprNestedSplice`")
def exprNestedSplice[T](ctx: QuoteContext)(x: ctx.Nested ?=> Expr[T]): T = ???

@compileTimeOnly("Illegal reference to `scala.internal.quoted.CompileTime.typeQuote`")
def typeQuote[T <: AnyKind]: Type[T] = ???

@compileTimeOnly("Illegal reference to `scala.internal.quoted.CompileTime.patternHole`")
def patternHole[T]: T = ???

@compileTimeOnly("Illegal reference to `scala.internal.quoted.CompileTime.patternBindHole`")
class patternBindHole extends Annotation

@compileTimeOnly("Illegal reference to `scala.internal.quoted.CompileTime.patternType`")
class patternType extends Annotation

@compileTimeOnly("Illegal reference to `scala.internal.quoted.CompileTime.fromAbove`")
class fromAbove extends Annotation

@compileTimeOnly("Illegal reference to `scala.internal.quoted.CompileTime.quoteTypeTag`")
class quoteTypeTag extends Annotation

Expand Down
6 changes: 6 additions & 0 deletions library/src-non-bootstrapped/scala/internal/quoted/Expr.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@ object Expr {
hasTypeSplices: Boolean, qctx: QuoteContext): Option[Tup] =
throw new Exception("Non bootstrapped lib")

def `null`: QuoteContext ?=> quoted.Expr[Null] =
throw new Exception("Non bootstrapped lib")

def Unit: QuoteContext ?=> quoted.Expr[Unit] =
throw new Exception("Non bootstrapped lib")

}
10 changes: 8 additions & 2 deletions library/src-non-bootstrapped/scala/quoted/Type.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package scala.quoted

abstract class Type[T <: AnyKind] private[scala]:
type `$splice` = T
import scala.annotation.compileTimeOnly

abstract class Type[X <: AnyKind] private[scala]:
type T = X
def unseal(using qctx: QuoteContext): qctx.tasty.TypeTree

object Type:
@compileTimeOnly("Reference to `scala.quoted.Type.apply` was not handled by ReifyQuotes")
given apply[T <: AnyKind] as (QuoteContext ?=> Type[T]) = ???
2 changes: 1 addition & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ object MyScalaJSPlugin extends AutoPlugin {
}

object Build {
val referenceVersion = "0.26.0-RC1"
val referenceVersion = "0.27.0-bin-20200819-6e6f67b-NIGHTLY"

val baseVersion = "0.27.0"
val baseSbtDottyVersion = "0.4.2"
Expand Down