Skip to content

Use Labeled blocks in TailRec, instead of label-defs. #5115

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 2 commits into from
Nov 6, 2018
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions compiler/src/dotty/tools/dotc/ast/tpd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
def Return(expr: Tree, from: Tree)(implicit ctx: Context): Return =
ta.assignType(untpd.Return(expr, from))

def Return(expr: Tree, from: Symbol)(implicit ctx: Context): Return =
Return(expr, Ident(from.termRef))

def WhileDo(cond: Tree, body: Tree)(implicit ctx: Context): WhileDo =
ta.assignType(untpd.WhileDo(cond, body))

Expand Down
2 changes: 2 additions & 0 deletions compiler/src/dotty/tools/dotc/core/NameKinds.scala
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ object NameKinds {
val NonLocalReturnKeyName: UniqueNameKind = new UniqueNameKind("nonLocalReturnKey")
val WildcardParamName: UniqueNameKind = new UniqueNameKind("_$")
val TailLabelName: UniqueNameKind = new UniqueNameKind("tailLabel")
val TailLocalName: UniqueNameKind = new UniqueNameKind("$tailLocal")
val TailTempName: UniqueNameKind = new UniqueNameKind("$tmp")
val ExceptionBinderName: UniqueNameKind = new UniqueNameKind("ex")
val SkolemName: UniqueNameKind = new UniqueNameKind("?")
val LiftedTreeName: UniqueNameKind = new UniqueNameKind("liftedTree")
Expand Down
Loading