summaryrefslogtreecommitdiff
path: root/sources/scalac/symtab/Symbol.java
diff options
context:
space:
mode:
Diffstat (limited to 'sources/scalac/symtab/Symbol.java')
-rw-r--r--sources/scalac/symtab/Symbol.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java
index 3390eb7a26..c6ebc39b6f 100644
--- a/sources/scalac/symtab/Symbol.java
+++ b/sources/scalac/symtab/Symbol.java
@@ -1057,6 +1057,18 @@ public abstract class Symbol implements Modifiers, Kinds {
return type().alternativeTypes();
}
+ /** if type is a overloaded type, return first stable alternative
+ * else return array symbol itself
+ */
+ public Symbol stableAlternative() {
+ switch (type()) {
+ case OverloadedType(Symbol[] alts, _):
+ for (int i = 0; i < alts.length; i++)
+ if (alts[i].isStable()) return alts[i];
+ }
+ return this;
+ }
+
/** The symbol accessed by this accessor function.
*/
public Symbol accessed() {
@@ -2151,7 +2163,7 @@ public class ClassSymbol extends TypeSymbol {
//System.out.println("field accessor = " + sym);//DEBUG
}
assert sym != null : this;
- return sym;
+ return sym.stableAlternative();
}
public final Symbol rebindSym() {