Skip to content

Enable tests that pass, move macro tests to disabled. #664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 9 additions & 3 deletions src/dotty/tools/dotc/transform/AugmentScala2Traits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import SymDenotations._
import Types._
import Decorators._
import DenotTransformers._
import Annotations._
import StdNames._
import NameOps._
import ast.Trees._
Expand Down Expand Up @@ -80,9 +81,14 @@ class AugmentScala2Traits extends MiniPhaseTransform with IdentityDenotTransform
for (sym <- mixin.info.decls) {
if (needsForwarder(sym) || sym.isConstructor || sym.isGetter && sym.is(Lazy))
implClass.enter(implMethod(sym.asTerm))
if (sym.isGetter && !sym.is(LazyOrDeferred) &&
!sym.setter.exists && !sym.info.resultType.isInstanceOf[ConstantType])
traitSetter(sym.asTerm).enteredAfter(thisTransform)
if (sym.isGetter)
if (sym.is(Lazy)) {
if (!sym.hasAnnotation(defn.VolatileAnnot))
sym.addAnnotation(Annotation(defn.VolatileAnnot, Nil))
}
else if (!sym.is(Deferred) && !sym.setter.exists &&
!sym.info.resultType.isInstanceOf[ConstantType])
traitSetter(sym.asTerm).enteredAfter(thisTransform)
if (sym.is(PrivateAccessor, butNot = ExpandedName) &&
(sym.isGetter || sym.isSetter)) // strangely, Scala 2 fields are also methods that have Accessor set.
sym.ensureNotPrivate.installAfter(thisTransform)
Expand Down
13 changes: 12 additions & 1 deletion src/dotty/tools/dotc/transform/Mixin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,18 @@ class Mixin extends MiniPhaseTransform with SymTransformer { thisTransform =>
if (isCurrent(getter) || getter.is(ExpandedName))
// transformFollowing call is needed to make memoize & lazy vals run
transformFollowing(
DefDef(implementation(getter.asTerm), if (isScala2x) default else initial))
DefDef(implementation(getter.asTerm),
if (isScala2x) {
if (getter.is(Flags.Lazy)) { // lazy vals need to have a rhs that will be the lazy initializer
val sym = mixin.implClass.info.nonPrivateDecl(getter.name).suchThat(_.info.paramTypess match {
case List(List(t: TypeRef)) => t.isDirectRef(mixin)
case _ => false
}).symbol // lazy val can be overloaded
ref(mixin.implClass).select(sym).appliedTo(This(ctx.owner.asClass))
}
else default
} else initial)
)
else if (isScala2x) EmptyTree
else initial
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading