diff options
author | Martin Odersky <odersky@gmail.com> | 2008-02-06 15:45:31 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-02-06 15:45:31 +0000 |
commit | 51e901a8c395eb2d08ff592c41c22acec7f543c8 (patch) | |
tree | b5362c403a7ff275c23525efb2b11be8d60e1e7e /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | 02c5a32843007fc4e6d9ddeab26fcf669c375d8e (diff) | |
download | scala-51e901a8c395eb2d08ff592c41c22acec7f543c8.tar.gz scala-51e901a8c395eb2d08ff592c41c22acec7f543c8.tar.bz2 scala-51e901a8c395eb2d08ff592c41c22acec7f543c8.zip |
fixed #412, prepared for structural array problem.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 6696a5cf7b..ca898d4c62 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -746,6 +746,15 @@ trait Typers { self: Analyzer => assert((mode & HKmode) == 0) //@M instantiate(tree, mode, pt) } else if (tree.tpe <:< pt) { + def isStructuralType(tpe: Type) = tpe match { + case RefinedType(ps, decls) => + decls.toList exists (x => x.isTerm && x.allOverriddenSymbols.isEmpty) + case _ => + false + } + if (isStructuralType(pt) && tree.tpe.typeSymbol == ArrayClass) { + println("need to insert box for "+tree) + } tree } else { if ((mode & PATTERNmode) != 0) { |