Permalink
Browse files

Revert "SI-6387 Clones accessor before name expansion"

This reverts commit 4e10b2c.

Add 6387 test to pending and 7341 to up-to-date.
  • Loading branch information...
1 parent 53e031f commit 2885eb0b2d49c33c707cecd2ee7b9588fe3f76ab @vigdorchik vigdorchik committed Apr 8, 2013
@@ -2538,32 +2538,20 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
}
/** change name by appending $$<fully-qualified-name-of-class `base`>
- * Do the same for any accessed symbols or setters/getters.
- * If the accessor to be renamed is overriding a base symbol, enter
- * a cloned symbol with the original name but without ACCESSOR flag.
+ * Do the same for any accessed symbols or setters/getters
*/
override def expandName(base: Symbol) {
- def expand(sym: Symbol) {
- if ((sym eq NoSymbol) || (sym hasFlag EXPANDEDNAME)) () // skip
- else sym setFlag EXPANDEDNAME setName nme.expandedName(sym.name.toTermName, base)
- }
- def cloneAndExpand(accessor: Symbol) {
- val clone = accessor.cloneSymbol(accessor.owner, (accessor.flags | ARTIFACT) & ~ACCESSOR)
- expand(accessor)
- log(s"Expanded overriding accessor to $accessor, but cloned $clone to preserve override")
- accessor.owner.info.decls enter clone
- }
- def expandAccessor(accessor: Symbol) {
- if (accessor.isOverridingSymbol) cloneAndExpand(accessor) else expand(accessor)
- }
- if (hasAccessorFlag && !isDeferred) {
- expand(accessed)
- }
- else if (hasGetter) {
- expandAccessor(getter(owner))
- expandAccessor(setter(owner))
+ if (!hasFlag(EXPANDEDNAME)) {
+ setFlag(EXPANDEDNAME)
+ if (hasAccessorFlag && !isDeferred) {
+ accessed.expandName(base)
+ }
+ else if (hasGetter) {
+ getter(owner).expandName(base)
+ setter(owner).expandName(base)
+ }
+ name = nme.expandedName(name.toTermName, base)
}
- expand(this)
}
protected def doCookJavaRawInfo() {
@@ -3235,7 +3223,6 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
override def companionModule = NoSymbol
override def companionSymbol = NoSymbol
override def isSubClass(that: Symbol) = false
- override def isOverridingSymbol = false
override def filter(cond: Symbol => Boolean) = this
override def defString: String = toString
override def locationString: String = ""
No changes.
@@ -0,0 +1 @@
+-Xcheckinit
View
@@ -0,0 +1,15 @@
+object Obj {
+ private var cache: Any = ()
+ def returning(f: () => Unit) = ()
+ def foo {
+ returning(() => cache = ())
+ }
+
+ def apply(): Any = {
+ cache
+ }
+}
+
+object Test extends App {
+ Obj()
+}
File renamed without changes.
File renamed without changes.

0 comments on commit 2885eb0

Please sign in to comment.