diff options
author | Paul Phillips <paulp@improving.org> | 2011-08-09 17:36:18 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-08-09 17:36:18 +0000 |
commit | 97da3af7a45a2cb88717ad8224e6b0b10531a734 (patch) | |
tree | 3bb29d4fb71278a9c6acdac7e6313cb9e635d346 /src/compiler/scala/reflect/internal/Types.scala | |
parent | c1aaf1fc7ad3d76bb5376d796577e0effdd70bf4 (diff) | |
download | scala-97da3af7a45a2cb88717ad8224e6b0b10531a734.tar.gz scala-97da3af7a45a2cb88717ad8224e6b0b10531a734.tar.bz2 scala-97da3af7a45a2cb88717ad8224e6b0b10531a734.zip |
Fix java signature generation for traits: no cl...
Fix java signature generation for traits: no classes as parents. Closes
SI-4891, review by grek.
Diffstat (limited to 'src/compiler/scala/reflect/internal/Types.scala')
-rw-r--r-- | src/compiler/scala/reflect/internal/Types.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler/scala/reflect/internal/Types.scala b/src/compiler/scala/reflect/internal/Types.scala index 4a2d8e9f08..7bcc0f8913 100644 --- a/src/compiler/scala/reflect/internal/Types.scala +++ b/src/compiler/scala/reflect/internal/Types.scala @@ -3070,6 +3070,18 @@ A type's typeSymbol should never be inspected directly. } } + /** Substitutes the empty scope for any non-empty decls in the type. */ + object dropAllRefinements extends TypeMap { + def apply(tp: Type): Type = tp match { + case rt @ RefinedType(parents, decls) if !decls.isEmpty => + mapOver(copyRefinedType(rt, parents, EmptyScope)) + case ClassInfoType(parents, decls, clazz) if !decls.isEmpty => + mapOver(ClassInfoType(parents, EmptyScope, clazz)) + case _ => + mapOver(tp) + } + } + // Set to true for A* => Seq[A] // (And it will only rewrite A* in method result types.) // This is the pre-existing behavior. |