Skip to content

StagedTuple changes #5822

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 7 commits into from
Apr 15, 2019
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
protected def debugPos: Boolean = ctx.settings.YdebugPos.value

def homogenize(tp: Type): Type =
if (homogenizedView)
if (homogenizedView) {
tp match {
case tp: ThisType if tp.cls.is(Package) && !tp.cls.isEffectiveRoot =>
ctx.requiredPackage(tp.cls.fullName).termRef
Expand All @@ -64,7 +64,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
case _ =>
tp
}
else tp
} else tp

private def sameBound(lo: Type, hi: Type): Boolean =
try lo frozen_=:= hi catch { case NonFatal(ex) => false }
Expand Down
9 changes: 8 additions & 1 deletion compiler/src/dotty/tools/dotc/transform/Splicer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ object Splicer {
}
catch {
case ex: scala.quoted.QuoteError =>
ctx.error(ex.getMessage, pos)
val pos1 = ex.from match {
case None => pos
case Some(expr) =>
val reflect: scala.tasty.Reflection = ReflectionImpl(ctx)
import reflect._
expr.unseal.underlyingArgument.pos.asInstanceOf[SourcePosition]
}
ctx.error(ex.getMessage, pos1)
EmptyTree
case NonFatal(ex) =>
val msg =
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/reference/other-new-features/tasty-reflect.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ def natConstImpl(x: Expr[Int])(implicit reflection: Reflection): Expr[Int] = {
xTree match {
case Term.Literal(Constant.Int(n)) =>
if (n <= 0)
throw new QuoteError("Parameter must be natural number")
QuoteError("Parameter must be natural number")
n.toExpr
case _ =>
throw new QuoteError("Parameter must be a known constant")
QuoteError("Parameter must be a known constant")
}
}
```
Expand Down
Loading