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

type alias suppresses unchecked warning #7984

Closed
scabug opened this issue Nov 19, 2013 · 2 comments
Closed

type alias suppresses unchecked warning #7984

scabug opened this issue Nov 19, 2013 · 2 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Nov 19, 2013

warning should be preserved for ints2 method

Welcome to Scala version 2.10.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_45).
Type in expressions to have them evaluated.
Type :help for more information.

scala> def ints(a: Any) = a match { case l: List[Int] => true; case _ => false }
<console>:7: warning: non-variable type argument Int in type pattern List[Int] is unchecked since it is eliminated by erasure
       def ints(a: Any) = a match { case l: List[Int] => true; case _ => false }
                                            ^
ints: (a: Any)Boolean

scala> ints(List("1"))
res0: Boolean = true

scala> type Ints = List[Int]
defined type alias Ints

scala> def ints2(a: Any) = a match { case l: Ints => true; case _ => false }
ints2: (a: Any)Boolean

scala> ints2(List("1"))
res1: Boolean = true

scala> 
@scabug
Copy link
Author

@scabug scabug commented Nov 19, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7984?orig=1
Reporter: Ievgen Platonov (jozic)
Affected Versions: 2.10.3

@scabug
Copy link
Author

@scabug scabug commented Nov 19, 2013

@scabug scabug closed this Nov 27, 2013
@scabug scabug added the patmat label Apr 7, 2017
@scabug scabug added this to the 2.11.0-M8 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants