-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use correct ErrorMessageID for EmptyCatchOrFinallyBlock
Previously we were always assigning this to `EmptyCatchOrFinallyBlockID` but both `EmptyCatchBlock` and `EmptyCatchAndFinallyBlock` both use this class and pass in their corresponding `ErrorMessageID`. This caused the following two code samples to give the same `ErrorMessageID` when they should have been different than they currently are: ```scala try {} ``` ```scala try {} catch {} finally {} ``` The second one gave this as an error: ``` scala> try {} catch {} finally {} -- [E000] Syntax Error: -------------------------------------------------------- 1 |try {} catch {} finally {} | ^^^^^^^^ | The catch block does not contain a valid expression, try | adding a case like - case e: Exception => to the block | | longer explanation available when compiling with `-explain` ``` When the ID should `E001`, `EmptyCatchBlockId`. Now this correctly returns: ``` scala> try {} catch{} finally {} -- [E001] Syntax Error: -------------------------------------------------------- 1 |try {} catch{} finally {} | ^^^^^^^ | The catch block does not contain a valid expression, try | adding a case like - case e: Exception => to the block | | longer explanation available when compiling with `-explain` ``` The first example with the missing catch and finally block should actually be `[E002]`.
- Loading branch information
Showing
6 changed files
with
14 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters