aboutsummaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2016-12-28 10:35:03 +0700
committerGitHub <noreply@github.com>2016-12-28 10:35:03 +0700
commit39c27b6a8aaa2c7303db54011082246ada06c0a0 (patch)
tree989c1187e1a50404c7873eb902471401fda741ce /compiler
parent5b984ac0628f64b41905ad89b5dc72751ae4f18f (diff)
parent18bc638c276c56e497bd39b58c9f3acf8b09f9e0 (diff)
downloaddotty-39c27b6a8aaa2c7303db54011082246ada06c0a0.tar.gz
dotty-39c27b6a8aaa2c7303db54011082246ada06c0a0.tar.bz2
dotty-39c27b6a8aaa2c7303db54011082246ada06c0a0.zip
Merge pull request #1850 from dotty-staging/fix-#1845
Fix #1845: Survive illegal this-type prefixes
Diffstat (limited to 'compiler')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala
index 4a97648f5..5c07b7bcf 100644
--- a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala
+++ b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala
@@ -282,7 +282,9 @@ trait TypeAssigner {
def assignType(tree: untpd.This)(implicit ctx: Context) = {
val cls = qualifyingClass(tree, tree.qual.name, packageOK = false)
- tree.withType(cls.thisType)
+ tree.withType(
+ if (cls.isClass) cls.thisType
+ else errorType("not a legal qualifying class for this", tree.pos))
}
def assignType(tree: untpd.Super, qual: Tree, inConstrCall: Boolean, mixinClass: Symbol = NoSymbol)(implicit ctx: Context) = {