diff options
author | Paul Phillips <paulp@improving.org> | 2010-03-04 05:22:57 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-03-04 05:22:57 +0000 |
commit | 34b8e8fcbbb1b11ce81bf69b730abcb78b6699ec (patch) | |
tree | b2ae69f2731acde0ec4b921cf2e1a73295ea3250 /src/compiler/scala/tools/nsc/transform/UnCurry.scala | |
parent | 65520ac86f5362bfa438c0b9e1a84f1f558e2618 (diff) | |
download | scala-34b8e8fcbbb1b11ce81bf69b730abcb78b6699ec.tar.gz scala-34b8e8fcbbb1b11ce81bf69b730abcb78b6699ec.tar.bz2 scala-34b8e8fcbbb1b11ce81bf69b730abcb78b6699ec.zip |
A few yards short of the goal posts attempt at ...
A few yards short of the goal posts attempt at making our usage of
Throwable subclasses more consistent. This patch eliminates a lot of
ad hoc Exception/Error/etc. creation and various arbitrary choices are
rendered slightly less arbitrary. From now on let's try not to use the
word "Exception" or "Error" in the names of Throwable subclasses unless
they actually derive (and make sense to derive) from Exception or Error.
Review by community.
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/UnCurry.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/UnCurry.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index c9c7548e6d..c22eae60c5 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -196,7 +196,7 @@ abstract class UnCurry extends InfoTransform with TypingTransformers { /** The type of a non-local return expression with given argument type */ private def nonLocalReturnExceptionType(argtype: Type) = - appliedType(NonLocalReturnExceptionClass.typeConstructor, List(argtype)) + appliedType(NonLocalReturnControlClass.typeConstructor, List(argtype)) /** A hashmap from method symbols to non-local return keys */ private val nonLocalReturnKeys = new HashMap[Symbol, Symbol] @@ -214,7 +214,7 @@ abstract class UnCurry extends InfoTransform with TypingTransformers { /** Generate a non-local return throw with given return expression from given method. * I.e. for the method's non-local return key, generate: * - * throw new NonLocalReturnException(key, expr) + * throw new NonLocalReturnControl(key, expr) * todo: maybe clone a pre-existing exception instead? * (but what to do about excaptions that miss their targets?) */ @@ -233,7 +233,7 @@ abstract class UnCurry extends InfoTransform with TypingTransformers { * try { * body * } catch { - * case ex: NonLocalReturnException[_] => + * case ex: NonLocalReturnControl[_] => * if (ex.key().eq(key)) ex.value() * else throw ex * } @@ -245,7 +245,7 @@ abstract class UnCurry extends InfoTransform with TypingTransformers { val ex = meth.newValue(body.pos, nme.ex) setInfo extpe val pat = Bind(ex, Typed(Ident(nme.WILDCARD), - AppliedTypeTree(Ident(NonLocalReturnExceptionClass), + AppliedTypeTree(Ident(NonLocalReturnControlClass), List(Bind(nme.WILDCARD.toTypeName, EmptyTree))))) val rhs = |