diff options
author | Martin Odersky <odersky@gmail.com> | 2003-11-21 10:14:16 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2003-11-21 10:14:16 +0000 |
commit | d9fad519e8d13b10e38649f5605c3d7009bca558 (patch) | |
tree | 33dc32435ea7d0b0c590a1be4b5424d1c57c4ded /sources/scalac/symtab/Type.java | |
parent | c69637585f3d084b73d492371b45f4ab178fd438 (diff) | |
download | scala-d9fad519e8d13b10e38649f5605c3d7009bca558.tar.gz scala-d9fad519e8d13b10e38649f5605c3d7009bca558.tar.bz2 scala-d9fad519e8d13b10e38649f5605c3d7009bca558.zip |
*** empty log message ***
Diffstat (limited to 'sources/scalac/symtab/Type.java')
-rw-r--r-- | sources/scalac/symtab/Type.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sources/scalac/symtab/Type.java b/sources/scalac/symtab/Type.java index e9a220fd55..1122d61f55 100644 --- a/sources/scalac/symtab/Type.java +++ b/sources/scalac/symtab/Type.java @@ -880,6 +880,7 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags { Type symtype = pre.memberType(sym).derefDef(); Type sym1type = pre.memberType(sym1).derefDef(); + if (sym1.isJava()) symtype = symtype.objParamToAny(); switch (sym1type) { case OverloadedType(Symbol[] alts, Type[] alttypes): for (int i = 0; i < alts.length; i++) { @@ -896,6 +897,25 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags { } } } + //where + static Map objToAnyMap = new Map() { + public Type apply(Type t) { + if (t.symbol() == Global.instance.definitions.JAVA_OBJECT_CLASS) + return Global.instance.definitions.ANY_TYPE(); + else return t; + } + }; + + private Type objParamToAny() { + switch (this) { + case MethodType(Symbol[] params, Type restp): + Symbol[] params1 = objToAnyMap.map(params); + if (params1 == params) return this; + else return MethodType(params1, restp); + default: + return this; + } + } // Set Owner ------------------------------------------------------------------ |