Johan
Johan

Reputation: 40558

Scala equivalent of combining generic types in Java?

In Java I have an interface with generic types defined like this:

public interface A extends B<C & D> {
  ...
}

How would the combined generic type of C & D be expressed in Scala? I've tried:

A <: B[C & D]

but it obviously gives me a compile error.

Upvotes: 2

Views: 120

Answers (1)

marstran
marstran

Reputation: 28056

The syntax is C with D. Check http://docs.scala-lang.org/tutorials/tour/compound-types.html for more info.

Upvotes: 5

Related Questions