diff options
author | Paul Phillips <paulp@improving.org> | 2009-02-19 12:49:23 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-02-19 12:49:23 +0000 |
commit | f4411a5ab0d4bfdb4f836296fc3d6900777c1077 (patch) | |
tree | e192e7143dcfbceed002ed6b87e5c8be8e1fb966 /src | |
parent | 5da9192e4a2a8930c2f90e233692451284b162d5 (diff) | |
download | scala-f4411a5ab0d4bfdb4f836296fc3d6900777c1077.tar.gz scala-f4411a5ab0d4bfdb4f836296fc3d6900777c1077.tar.bz2 scala-f4411a5ab0d4bfdb4f836296fc3d6900777c1077.zip |
Fix for #1700.
Diffstat (limited to 'src')
-rwxr-xr-x | src/compiler/scala/tools/nsc/javac/JavaParsers.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala index c5acc7a26c..ae0712e7a6 100755 --- a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala +++ b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala @@ -625,9 +625,9 @@ trait JavaParsers extends JavaScanners { Import(Ident(cdef.name.toTermName), List((nme.WILDCARD, null))) } + // create companion object even if it has no statics, so import A._ works; bug #1700 def addCompanionObject(statics: List[Tree], cdef: ClassDef): List[Tree] = - if (statics.isEmpty) List(cdef) - else List(makeCompanionObject(cdef, statics), importCompanionObject(cdef), cdef) + List(makeCompanionObject(cdef, statics), importCompanionObject(cdef), cdef) def importDecl(): List[Tree] = { accept(IMPORT) |