Muki-SkyWalker / specs

Automatically exported from code.google.com/p/specs
Other
0 stars 0 forks source link

Enhancement: ExceptionClassMatcher.like should take a more specific type #120

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

  foo() must throwA[MyException] like { case m => m.myMethod() == 42 } 

What is the expected output? What do you see instead?

  The above code won't compile, because like takes a
PartialFunction[Throwable, Boolean] as parameter. I'd suggest that
PartialFunction[E, Boolean] would be expected, removing the need for
pattern matching on the type of the exception.

  Currently you are required to write:
   ... like { case m: MyException => m.myMethod() == 42 }
  which increases clutter.

What version of the product are you using? On what operating system?

  2.8.0.Beta1_1.6.2

Please provide any additional information below.

  (none)

Original issue reported on code.google.com by m5knei...@googlemail.com on 19 Feb 2010 at 10:20

GoogleCodeExporter commented 8 years ago
That should work in principle, see
http://bitbucket.org/mkneissl/snippets/src/08b5cad54bdb/ScalaSnippets/src/eu/kne
issl/scalasnippets/ExceptionSpecification.scala
for a rough demo.

Original comment by m5knei...@googlemail.com on 19 Feb 2010 at 1:12

GoogleCodeExporter commented 8 years ago

Original comment by etorrebo...@gmail.com on 20 Feb 2010 at 10:57

GoogleCodeExporter commented 8 years ago
Thanks Martin for your code sample. I've fixed the issue. Please wait a bit for 
me to 
deploy the snapshot containing the fix.

Original comment by etorrebo...@gmail.com on 21 Feb 2010 at 9:13

GoogleCodeExporter commented 8 years ago

Original comment by etorrebo...@gmail.com on 26 May 2010 at 10:26