aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/ast/Trees.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-01-02 18:13:01 +0100
committerMartin Odersky <odersky@gmail.com>2014-01-02 18:19:24 +0100
commit9955a2fd64af1ff7b9992fa12662a85e07d82fc7 (patch)
tree20af8ab4d4e060c98bc7767262665d34bef46eac /src/dotty/tools/dotc/ast/Trees.scala
parent1aaca404f83020a06a460d56841cd0a6b82b989b (diff)
downloaddotty-9955a2fd64af1ff7b9992fa12662a85e07d82fc7.tar.gz
dotty-9955a2fd64af1ff7b9992fa12662a85e07d82fc7.tar.bz2
dotty-9955a2fd64af1ff7b9992fa12662a85e07d82fc7.zip
Fixing a type problem where code does not compile under dotty.
... and I believe should not compile under Scala2x either. The problem is in line 361 of TreeInfo.scala methPart(tree) match { ... Here, tree: tpd.Tree methPart: (tree: this.Tree): Tree So we need to show that tpd.Tree <: this.Tree LHS expands to ast.Tree[Type] RHS expands to ast.Tree[T] where T >: Untyped is TreeInfo's type parameter Since Tree is contravariant, we need to etablish T <: Type but I see nothing that could prove this. The Dotty typechecker detected the problem, yet Scala2x's didn't. Need to follow up on why not. For now, adding the necessary constraint to the codebase.
Diffstat (limited to 'src/dotty/tools/dotc/ast/Trees.scala')
-rw-r--r--src/dotty/tools/dotc/ast/Trees.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/ast/Trees.scala b/src/dotty/tools/dotc/ast/Trees.scala
index 12d71e32f..13f7d6f18 100644
--- a/src/dotty/tools/dotc/ast/Trees.scala
+++ b/src/dotty/tools/dotc/ast/Trees.scala
@@ -801,7 +801,7 @@ object Trees {
// ----- Generic Tree Instances, inherited from `tpt` and `untpd`.
- abstract class Instance[T >: Untyped] extends DotClass { inst =>
+ abstract class Instance[T >: Untyped <: Type] extends DotClass { inst =>
type Modifiers = Trees.Modifiers[T]
type Tree = Trees.Tree[T]