Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warning #941

Merged

Conversation

mlangc
Copy link
Contributor

@mlangc mlangc commented May 3, 2015

Fixes #1002444

@ghprb-bot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins.scala-ide.org:8496/jenkins//job/ghprb-scala-ide-multi-conf/118/
Test PASSed.

@@ -131,6 +131,7 @@ class MoveClass extends RefactoringExecutorWithWizard {
(change :: textChanges, newFiles)
case (change: NewFileChange, (textChanges, newFilesChanges)) =>
(textChanges, change :: newFilesChanges)
case (other, _) => throw new AssertionError(s"Unexpected change $other")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please improve the message in a way that it explains that only TextChange and NewFileChange make sense here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any difference between throwing MatchError and AssertionError. Actually, as @sschaef noticed, MatchError gives you more information. I understand the warning is gone, but then let's report the error in a better way. (or use @unchecked to silence the warning).

Fixes #1002444
@mlangc mlangc force-pushed the compiler-warning-in-move-class-1002444 branch from e5cff9f to ef17feb Compare May 4, 2015 20:13
@mlangc
Copy link
Contributor Author

mlangc commented May 4, 2015

Hmm, you have a point. Please tell me if you like the new message better; if not I'd go for the @unchecked option.

@ghprb-bot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins.scala-ide.org:8496/jenkins//job/ghprb-scala-ide-multi-conf/121/
Test PASSed.

@kiritsuku
Copy link
Member

LGTM

kiritsuku added a commit that referenced this pull request May 5, 2015
@kiritsuku kiritsuku merged commit bd465dc into scala-ide:master May 5, 2015
@mlangc mlangc deleted the compiler-warning-in-move-class-1002444 branch June 17, 2015 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants