diff options
author | Martin Odersky <odersky@gmail.com> | 2015-08-04 18:34:10 -0700 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-08-04 18:34:10 -0700 |
commit | ac226f26d8f54c79c642ed88bc5c48916afeb61b (patch) | |
tree | d6da7d399826b1652957e18504f10e64f41ae4d4 /src/dotty/tools/dotc/ast/tpd.scala | |
parent | 07e24e8640acf19a6bcedd1b68acbd7c8d8bf29b (diff) | |
download | dotty-ac226f26d8f54c79c642ed88bc5c48916afeb61b.tar.gz dotty-ac226f26d8f54c79c642ed88bc5c48916afeb61b.tar.bz2 dotty-ac226f26d8f54c79c642ed88bc5c48916afeb61b.zip |
Implement non-local returns
Non-local returns are now implemented.
Diffstat (limited to 'src/dotty/tools/dotc/ast/tpd.scala')
-rw-r--r-- | src/dotty/tools/dotc/ast/tpd.scala | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/ast/tpd.scala b/src/dotty/tools/dotc/ast/tpd.scala index b05d23107..4e9940ac4 100644 --- a/src/dotty/tools/dotc/ast/tpd.scala +++ b/src/dotty/tools/dotc/ast/tpd.scala @@ -161,6 +161,10 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo { def Bind(sym: TermSymbol, body: Tree)(implicit ctx: Context): Bind = ta.assignType(untpd.Bind(sym.name, body), sym) + /** A pattern corrsponding to `sym: tpe` */ + def BindTyped(sym: TermSymbol, tpe: Type)(implicit ctx: Context): Bind = + Bind(sym, Typed(Underscore(tpe), TypeTree(tpe))) + def Alternative(trees: List[Tree])(implicit ctx: Context): Alternative = ta.assignType(untpd.Alternative(trees), trees) |