Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 0.9
-
Fix Version/s: 0.9
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
The compiler allows the following code to compile:
try:
raise System.Exception()
except System.ArgumentException:
pass
Issue Links
| This issue relates to: | ||||
| BOO-877 | Exception Handling: Allow anonymous typed handlers |
|
|
|
Couldn't reproduce against SVN build :
cedric@laptop:~/dev/workspace/boo-svn/sandbox$ cat exception.boo
try:
raise System.Exception()
except System.ArgumentException:
pass
cedric@laptop:~/dev/workspace/boo-svn/sandbox$ booc exception.boo
Boo Compiler version 0.7.6.2437 (CLR v2.0.50727.42)
exception.boo(3,14): BCE0043: Unexpected token: ..
1 error(s).
However it compiles fine if we import System and then use "except ArgumentException" as shown above.
Should we ensure the "name" is not a type ? or maybe we could allow the "name" to be a type reference here (as long as it is subclassing Exception? [1]) and just handles this transparently as in c# ?
[1] : as far as I know the CLR does not actually have this restriction but well...