10000 Fix deprecation warnings by Philippus · Pull Request #214 · scala/scala-async · GitHub
[go: up one dir, main page]

Skip to content

Fix deprecation warnings #214

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 17 commits into from
Feb 22, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix deprecation warnings nme -> termNames
  • Loading branch information
Philippus committed Feb 16, 2019
commit b8b9f6b11e2e4dae154f6e28792bc0bacdf2f6bc
2 changes: 1 addition & 1 deletion src/main/scala/scala/async/internal/AnfTransform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private[async] trait AnfTransform {
def statsExprUnit =
stats :+ expr :+ api.typecheck(atPos(expr.pos)(Literal(Constant(()))))
def statsExprThrow =
stats :+ expr :+ api.typecheck(atPos(expr.pos)(Throw(Apply(Select(New(gen.mkAttributedRef(defn.IllegalStateExceptionClass)), nme.CONSTRUCTOR), Nil))))
stats :+ expr :+ api.typecheck(atPos(expr.pos)(Throw(Apply(Select(New(gen.mkAttributedRef(defn.IllegalStateExceptionClass)), termNames.CONSTRUCTOR), Nil))))
expr match {
case Apply(fun, args) if isAwait(fun) =>
val valDef = defineVal(name.await(), expr, tree.pos)
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/scala/async/internal/AsyncTransform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ trait AsyncTransform {

Block(List[Tree](
stateMachineSpliced,
ValDef(NoMods, name.stateMachine, TypeTree(), Apply(Select(New(Ident(stateMachine.symbol)), nme.CONSTRUCTOR), Nil)),
ValDef(NoMods, name.stateMachine, TypeTree(), Apply(Select(New(Ident(stateMachine.symbol)), termNames.CONSTRUCTOR), Nil)),
futureSystemOps.spawn(Apply(selectStateMachine(name.apply), Nil), selectStateMachine(name.execContext))
),
futureSystemOps.promiseToFuture(c.Expr[futureSystem.Prom[T]](selectStateMachine(name.result))).tree)
Expand Down Expand Up @@ -205,7 +205,7 @@ trait AsyncTransform {
atPos(tree.pos) {
gen.mkAttributedStableRef(thisType(fieldSym.owner.asClass), fieldSym).setType(tree.tpe)
}
case sel @ Select(n@New(tt: TypeTree), nme.CONSTRUCTOR) =>
case sel @ 10000 Select(n@New(tt: TypeTree), termNamesCONSTRUCTOR) =>
adjustType(sel)
adjustType(n)
adjustType(tt)
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/scala/async/internal/ExprBuilder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -523,14 +523,14 @@ trait ExprBuilder {
private def resumeFunTree[T: WeakTypeTag]: Tree = {
val stateMemberSymbol = symLookup.stateMachineMember(name.state)
val stateMemberRef = symLookup.memberRef(name.state)
val body = Match(stateMemberRef, mkCombinedHandlerCases[T] ++ initStates.flatMap(_.mkOnCompleteHandler[T]) ++ List(CaseDef(Ident(nme.WILDCARD), EmptyTree, Throw(Apply(Select(New(Ident(defn.IllegalStateExceptionClass)), termNames.CONSTRUCTOR), List())))))
val body = Match(stateMemberRef, mkCombinedHandlerCases[T] ++ initStates.flatMap(_.mkOnCompleteHandler[T]) ++ List(CaseDef(Ident(termNames.WILDCARD), EmptyTree, Throw(Apply(Select(New(Ident(defn.IllegalStateExceptionClass)), termNames.CONSTRUCTOR), List())))))
val body1 = compactStates(body)

maybeTry(
body1,
List(
CaseDef(
Bind(name.t, Typed(Ident(nme.WILDCARD), Ident(defn.ThrowableClass))),
Bind(name.t, Typed(Ident(termNames.WILDCARD), Ident(defn.ThrowableClass))),
EmptyTree, {
val then = {
val t = c.Expr[Throwable](Ident(name.t))
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/scala/async/internal/TransformUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ private[async] trait TransformUtils {
}

def emptyConstructor: DefDef = {
val emptySuperCall = Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), nme.CONSTRUCTOR), Nil)
DefDef(NoMods, nme.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(emptySuperCall), Literal(Constant(()))))
val emptySuperCall = Apply(Select(Super(This(typeNames.EMPTY), typeNames.EMPTY), termNames.CONSTRUCTOR), Nil)
DefDef(NoMods, termNames.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(emptySuperCall), Literal(Constant(()))))
}

def applied(className: String, types: List[Type]): AppliedTypeTree =
Expand Down
0