This page is no longer maintained — Please continue to the home page at www.scala-lang.org

How to use a method whose name is "with"

2 replies
Laurent Bourgau...
Joined: 2012-02-10,
User offline. Last seen 42 years 45 weeks ago.

I am trying to use Guice and Jersey along with scala. However, it fail
on the following line

serve("/*").with(classOf[ServletContainer])

The error is

error: identifier expected but 'with' found.

The name of the method is with. I can't really use anything else. How
can I call it?

Viktor Klang
Joined: 2008-12-17,
User offline. Last seen 1 year 27 weeks ago.
Re: How to use a method whose name is "with"

On Fri, Feb 10, 2012 at 7:41 AM, Laurent Bourgault-Roy
wrote:
> I am trying to use Guice and Jersey along with scala. However, it fail
> on the following line
>
> serve("/*").with(classOf[ServletContainer])

serve("/*").`with`(classOf[ServletContainer])

>
> The error is
>
> error: identifier expected but 'with' found.
>
> The name of the method is with. I can't really use anything else. How
> can I call it?

Laurent Bourgau...
Joined: 2012-02-10,
User offline. Last seen 42 years 45 weeks ago.
Re: How to use a method whose name is "with"

On 10 fév, 01:46, √iktor Ҡlang wrote:
> On Fri, Feb 10, 2012 at 7:41 AM, Laurent Bourgault-Roy
>
> wrote:
> > I am trying to use Guice and Jersey along with scala. However, it fail
> > on the following line
>
> > serve("/*").with(classOf[ServletContainer])
>
> serve("/*").`with`(classOf[ServletContainer])
>

Fixed It. Thank you

>
>
> > The error is
>
> > error: identifier expected but 'with' found.
>
> > The name of the method is with. I can't really use anything else. How
> > can I call it?
>
> --
> Viktor Klang
>
> Akka Tech Lead
> Typesafe - The software stack for applications that scale
>
> Twitter: @viktorklang

Laurent Bourgault-Roy

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland