diff options
author | Martin Odersky <odersky@gmail.com> | 2014-01-02 18:13:01 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-01-02 18:19:24 +0100 |
commit | 9955a2fd64af1ff7b9992fa12662a85e07d82fc7 (patch) | |
tree | 20af8ab4d4e060c98bc7767262665d34bef46eac /test/dotc | |
parent | 1aaca404f83020a06a460d56841cd0a6b82b989b (diff) | |
download | dotty-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 'test/dotc')
-rw-r--r-- | test/dotc/tests.scala | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala index 6242adc65..61e9a170c 100644 --- a/test/dotc/tests.scala +++ b/test/dotc/tests.scala @@ -39,11 +39,5 @@ class tests extends CompilerTest { @Test def neg_typers() = compileFile(negDir, "typers", xerrors = 10) @Test def dotc = compileDir(dotcDir + "tools/dotc") - //@Test def dotc_ast = compileDir(dotcDir + "tools/dotc/ast") - @Test def dotc_checktrees = compileFile(dotcDir + "tools/dotc/ast/", "CheckTrees") - @Test def dotc_trees = compileFile(dotcDir + "tools/dotc/ast/", "Trees") - @Test def dotc_untpd = compileFile(dotcDir + "tools/dotc/ast/", "untpd") - @Test def dotc_tpd = compileFile(dotcDir + "tools/dotc/ast/", "tpd") - @Test def dotc_desugar = compileFile(dotcDir + "tools/dotc/ast/", "Desugar") - + @Test def dotc_ast = compileDir(dotcDir + "tools/dotc/ast") }
\ No newline at end of file |