score:1
searching for bugs on pattern matcher is pretty useless right now, unless you are testing your code on 2.10.x or master. for two reasons:
- there are so many bugs in the pattern matcher, that finding the right one is very hard.
- the code on 2.10.x is entirely new, so the bugs on the old pattern matcher are just not relevant to the new pattern matcher (which fixed most, if not all, of them).
score:2
on scala-2.10.0-m6 your code prints the following:
scala> testall()
test: 3
pattern recognized: primary(3)
full-pattern detection failed
pat@int detected: primary(3)
full-full detection failed
pattern recognized: full(3,1.0)
full@int detected: full(3,1.0)
pat@int detected: full(3,1.0)
full@int detected: full(3,1.0)
test: 5.0
pattern recognized: primary(5.0)
pat@float detected: primary(5.0)
pat@float detected: primary(5.0)
full-full detection failed
pattern recognized: full(5.0,1.0)
pat@float detected: full(5.0,1.0)
pat@float detected: full(5.0,1.0)
full@float detected: full(5.0,1.0)
full(5.0f, 1.0f)
now matches pattern(c: float)
, other tests seems to work as they should.
Source: stackoverflow.com
Related Query
- Identify a bug in pattern matcher
- Working around nasty Pattern Matcher bug
- How to prevent this kind of bug - pattern matching and Nil
- How much optimization does Scala's pattern matcher perform?
- Regex Matching using Matcher and Pattern
- Scala identify string with pattern matching
- Using comparison operators in Scala's pattern matching system
- How to pattern match using regular expression in Scala?
- How is pattern matching in Scala implemented at the bytecode level?
- Why does pattern matching in Scala not work with variables?
- Scala multiple type pattern matching
- How do I apply the enrich-my-library pattern to Scala collections?
- How to pattern match multiple values in Scala?
- Pattern matching vs if-else
- Pattern Matching `@` Symbol
- How do I pattern match arrays in Scala?
- How do you do dependency injection with the Cake pattern without hardcoding?
- Scala pattern matching on sequences other than Lists
- Pattern matching with conjunctions (PatternA AND PatternB)
- Identify and describe Scala's generic type constraints
- How to use switch/case (simple pattern matching) in Scala?
- Haskell, Scala, Clojure, what to choose for high performance pattern matching and concurrency
- Scala: short form of pattern matching that returns Boolean
- How to pattern match large Scala case classes?
- What is scala's experimental virtual pattern matcher?
- Strange sbt bug where I cannot import sbt project due to keys colliding with themselves
- How can I pattern match on a range in Scala?
- How does | (pipe) in pattern matching work?
- Scala pattern matching confusion with Option[Any]
- String pattern matching best practice
More Query from same tag
- Generic "nested members" trait
- Is there a way to map a JSON object with more then 22 keys in Scala (2.12.4) Play2 (2.6.3)?
- andThen with square brackets and underscore in Scala function
- Why implicitConversions is required for implicit defs but not classes?
- Mock is returning stubbed result for arbitrary param
- How to call java method taking parameter as List<Class<?>> from Scala
- Custom equality between classes
- How to listen redis list event with redisson and ZIO
- How to exit a sbt task?
- spark standalone application out of memory on small text files
- In Scala, does a no-more-referenced object can be garbage collected during flatMap?
- Select rows with part duplicate rows Spark Scala
- In SBT, how to use addSbtPlugin with a Github URL?
- What does it mean that the types have to align in for-comprensions?
- Java or Scala fast way to parse dates with many different formats using java.time
- swing issues in scala
- Insert one method invocation into many other methods
- Does collect_list() maintain relative ordering of rows?
- How to collapse 2D array by eliminating all empty/null entries
- Map exceptions to HTTP result
- Slick Try(query(run)) always return success
- How to find an element in a tree using scala
- Storing each operation of fold operation in List
- How does nifi generate documentation?
- Spark2.4 Unable to overwrite table from same table
- Merging Arrays in scala
- Separating application logs in Logback from Spark Logs in log4j
- Handling scala array group with ties
- Actor and Future: Referring to an actor message within onComplete
- Scala: Implementing a mathematical recursion with convergence