aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2016-11-06 10:46:27 +0100
committerGitHub <noreply@github.com>2016-11-06 10:46:27 +0100
commit913f76a482efc733c01dd262a72de78e795d4b7b (patch)
tree70eb84e7cbd58884094c4d0e23c58bb67a18fc21 /src
parenta55a2607c7376ed81141ef958d6a8eeaeea8fd72 (diff)
parentcf351a20fcd9de79eedeca76fad59bad55d5a5ec (diff)
downloaddotty-913f76a482efc733c01dd262a72de78e795d4b7b.tar.gz
dotty-913f76a482efc733c01dd262a72de78e795d4b7b.tar.bz2
dotty-913f76a482efc733c01dd262a72de78e795d4b7b.zip
Merge pull request #1660 from dotty-staging/fix-#1643
Fix #1643: More robust untpd.New
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/ast/untpd.scala2
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala10
2 files changed, 10 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/ast/untpd.scala b/src/dotty/tools/dotc/ast/untpd.scala
index ac3beaff4..f259bdc57 100644
--- a/src/dotty/tools/dotc/ast/untpd.scala
+++ b/src/dotty/tools/dotc/ast/untpd.scala
@@ -282,7 +282,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
case TypedSplice(AppliedTypeTree(tycon, targs)) =>
(TypedSplice(tycon), targs map (TypedSplice(_)))
case TypedSplice(tpt1: Tree) =>
- val argTypes = tpt1.tpe.argTypes
+ val argTypes = tpt1.tpe.argTypesLo
val tycon = tpt1.tpe.withoutArgs(argTypes)
def wrap(tpe: Type) = TypeTree(tpe) withPos tpt.pos
(wrap(tycon), argTypes map wrap)
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 899b857ae..95f0c5614 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -241,7 +241,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
/** Would import of kind `prec` be not shadowed by a nested higher-precedence definition? */
def isPossibleImport(prec: Int)(implicit ctx: Context) =
- !noImports &&
+ !noImports &&
(prevPrec < prec || prevPrec == prec && (prevCtx.scope eq ctx.scope))
@tailrec def loop(implicit ctx: Context): Type = {
@@ -446,6 +446,14 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
case _ =>
}
checkClassType(tpt1.tpe, tpt1.pos, traitReq = false, stablePrefixReq = true)
+
+ tpt1 match {
+ case AppliedTypeTree(_, targs) =>
+ for (targ @ TypeBoundsTree(_, _) <- targs)
+ ctx.error("type argument must be fully defined", targ.pos)
+ case _ =>
+ }
+
assignType(cpy.New(tree)(tpt1), tpt1)
// todo in a later phase: checkInstantiatable(cls, tpt1.pos)
}