Reputation: 10936
Given the following minimal example:
interface IA
interface IB
class Foo1<T> where T : IA, T : IB {
val x: Int
constructor(x: Int) {
this.x = x
}
}
class Foo2<T>(val x: Int)
class Foo3<T> where T : IA, T : IB (val x: Int) // Error
Foo3
is a syntax error? What am I doing wrong?
Upvotes: 0
Views: 47
Reputation: 511
In C# where
clause comes after parameters.
class Foo3<T> (x: Int) where T : IA, T : IB
Upvotes: 2