diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-02-01 17:26:11 +0100 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-02-01 17:26:11 +0100 |
commit | 39457f6c85fc9764d714d52317edcd4300fd82b8 (patch) | |
tree | 4813f1ee5585e0d8c1c3e9984cad0a7798e54d71 /test/files/run/virtpatmat_switch.scala | |
parent | aa7759651d25ab8c315a2d36e3f28cf3caaa041f (diff) | |
download | scala-39457f6c85fc9764d714d52317edcd4300fd82b8.tar.gz scala-39457f6c85fc9764d714d52317edcd4300fd82b8.tar.bz2 scala-39457f6c85fc9764d714d52317edcd4300fd82b8.zip |
Convert values to Int in switchable patterns.
Further improvements to how -Yvirtpatmat
handles switch-like patterns that can be
translated to switch tables.
First of all, we added a check whether
a type of an expression we pattern match
on is in the set of allowed types for
switch patterns.
If yes, we translate a pattern to switch
one by converting both an expression we
pattern match on and literals in a pattern
to an Int.
I borrowed an idea of converting to Ints
from both old pattern matcher implementation
and from how javac handles it.
Diffstat (limited to 'test/files/run/virtpatmat_switch.scala')
0 files changed, 0 insertions, 0 deletions