Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.10.3
    • Fix Version/s: Scala 2.11.0-M8
    • Component/s: Pattern Matcher
    • Labels:
    • Environment:

      ubuntu 12.04/mint 13

      Description

      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> 
      

        Activity

        Show
        Jason Zaugg added a comment - https://github.com/scala/scala/pull/3161

          People

          • Assignee:
            Jason Zaugg
            Reporter:
            Ievgen Platonov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development