diff options
author | Nicolas Stucki <nicolas.stucki@gmail.com> | 2016-06-10 11:14:17 +0200 |
---|---|---|
committer | Nicolas Stucki <nicolas.stucki@gmail.com> | 2016-06-28 11:08:53 +0200 |
commit | b0ebe6ad30ce2584aa221b3ed8d10042bd9e97ac (patch) | |
tree | f7072a30b533821762dc0a18e5a5ba3e76e4ead5 /src/dotty/tools/dotc/Compiler.scala | |
parent | cc87bd3b452e76ae974504c4f4e6beba996be3e8 (diff) | |
download | dotty-b0ebe6ad30ce2584aa221b3ed8d10042bd9e97ac.tar.gz dotty-b0ebe6ad30ce2584aa221b3ed8d10042bd9e97ac.tar.bz2 dotty-b0ebe6ad30ce2584aa221b3ed8d10042bd9e97ac.zip |
Fix #856: Handle try/catch cases as catch cases if possible.
Previously they were all lifted into a match with the came cases.
Now the first cases are handled directly by by the catch. If one
of the cases can not be handled the old scheme is applied to to it
and all subsequent cases.
Diffstat (limited to 'src/dotty/tools/dotc/Compiler.scala')
-rw-r--r-- | src/dotty/tools/dotc/Compiler.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/Compiler.scala b/src/dotty/tools/dotc/Compiler.scala index 3844f42a7..ce9280d82 100644 --- a/src/dotty/tools/dotc/Compiler.scala +++ b/src/dotty/tools/dotc/Compiler.scala @@ -57,7 +57,8 @@ class Compiler { new TailRec, // Rewrite tail recursion to loops new LiftTry, // Put try expressions that might execute on non-empty stacks into their own methods new ClassOf), // Expand `Predef.classOf` calls. - List(new PatternMatcher, // Compile pattern matches + List(new TryCatchPatterns, // Compile cases in try/catch + new PatternMatcher, // Compile pattern matches new ExplicitOuter, // Add accessors to outer classes from nested ones. new ExplicitSelf, // Make references to non-trivial self types explicit as casts new CrossCastAnd, // Normalize selections involving intersection types. |