2.11.2 (akka 2.3.4)
scalacOptions := Seq("-feature", "-deprecation", "-encoding", "utf8",
"-Xlint")
On 23 September 2014 21:26, Adam <[email protected]> wrote:
> Interesting.
> Which Scala version are you using?
>
> I've copied your code into a Scala project I have that uses Scala 2.11.2
> (with akka 2.3.6) and I get no warnings.
> Also the IDE (Intellij) correctly shows that receive is of type
> PartialFunction[Any,Unit].
>
> Have you tried modifying it to:
>
> def receive: Receive = { x orElse y }
>
> ?
>
> I would assume that should cause type inference to be skipped and
> therefore also make the warning go away, like in the previous answer.
>
>
> On Tuesday, September 23, 2014 7:29:08 PM UTC+3, Tim Pigden wrote:
>>
>> The following example:
>>
>> class TestPF extends Actor {
>>
>> val x: Receive = {
>> case "hi" => sender ! "hello"
>> }
>>
>> val y: Receive = {
>> case "bye" => sender ! "farewell"
>> }
>>
>> def receive = { x orElse y }
>>
>> }
>>
>> gets a warning
>> Warning:(18, 28) a type was inferred to be `Any`; this may indicate a
>> programming error.
>> def receive = { x orElse y }
>> ^
>>
>> Am I doing something wrong? I thought this was the intended use pattern.
>> Can I make these warnings go away?
>>
> --
> >>>>>>>>>> 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 a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/akka-user/0rkUCQxru5I/unsubscribe.
> To unsubscribe from this group and all its topics, 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.
>
--
Tim Pigden
Optrak Distribution Software Limited
+44 (0)1992 517100
http://www.linkedin.com/in/timpigden
http://optrak.com
Optrak Distribution Software Ltd is a limited company registered in England
and Wales.
Company Registration No. 2327613 Registered Offices: Suite 6,The Maltings,
Hoe Lane, Ware, SG12 9LR England
This email and any attachments to it may be confidential and are intended
solely for the use of the individual to whom it is addressed. Any views or
opinions expressed are solely those of the author and do not necessarily
represent those of Optrak Distribution Software Ltd. If you are not the
intended recipient of this email, you must neither take any action based
upon its contents, nor copy or show it to anyone. Please contact the sender
if you believe you have received this email in error.
--
>>>>>>>>>> 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.