Hello there,
As I understand it, wart-remover is configurable to which "warts” it should be 
reporting.

In the case of Actor.Receive it’s not happy because it is an alias to Any => 
Unit. 
Without a large philosophical dive why it is such and not a different signature 
(and btw. Roland will soon soon get a new impl ot akka.typed out for preview 
;-)),
let’s address your problem and question at hand.

Two solutions come to mind:
1) Since the wart is triggered for “inferred type contains Any”, you can write 
the type explicitly (def receive: Receive = …) instead of it being inferred I 
assume? (Did not try that though)

2) As seen on: https://github.com/puffnfresh/wartremover these warts can be 
enabled / disabled at will.
warts can be configured and in your case you’d like to keep all “except 
inferred type contains Any”,
so you could use:
    
    wartremoverErrors := Warts.allBut(Wart.Any)

which should make it happy on receive methods.


Hope this helps!
Disclaimer: I did not try this, but it seems to all logically fall into place 
:-)

-- 
Konrad 'ktoso’ Malawski
Akka @ Typesafe

On 15 January 2015 at 22:24:00, javierg ([email protected]) wrote:

Hi all, 
Apologies for the more than slightly offtopic question.
I recently started using WartRemover and one of the first things that I 
encountered is a barrage of error notifications like what follows (for, as long 
as I can see, every receive method in my codebase)

Error:(31, 7) Inferred type containing Any
  def receive = {
      ^
Before WartRemover this code used to compile (and run) without issues. 
WartRemover claims it doesn't report false positives, but I'm getting this 
error on cases as simple and trivial as the following (admittedly contrived) 
example

def receive = {
    case a:String => log.info(a)
    case _ => log.info("Unexpected input")
} 

Is there a way to solve this (other than asking WartRemover to not report this)?
Thanks in advance,

Javier 


--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to