You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome to Scala version 2.10.3 (JavaHotSpot(TM) 64-BitServerVM, Java1.7.0_45).
Type in expressions to have them evaluated.
Type:help for more information.
scala>defints(a: Any) = a match { casel: List[Int] =>true; case _ =>false }
<console>:7:warning: non-variable typeargumentInt in typepatternList[Int] is unchecked since it is eliminated by erasure
defints(a: Any) = a match { casel: List[Int] =>true; case _ =>false }
^
ints: (a: Any)Boolean
scala> ints(List("1"))
res0:Boolean=true
scala>typeInts=List[Int]
defined typealiasInts
scala>defints2(a: Any) = a match { casel: Ints=>true; case _ =>false }
ints2: (a: Any)Boolean
scala> ints2(List("1"))
res1:Boolean=true
scala>
The text was updated successfully, but these errors were encountered:
warning should be preserved for ints2 method
The text was updated successfully, but these errors were encountered: