https://kotlinlang.org logo
#getting-started
Title
# getting-started
r

robstoll

02/16/2023, 3:34 PM
ah got it
class Foo<T> where T: I, ... ()
and not after
()
as for functions
🧵 4
s

Sam

02/16/2023, 3:37 PM
I don’t think this is right. The
where
clause goes after the default constructor and before the class body.
Got an example of what you tried that isn’t working?
r

robstoll

02/16/2023, 3:37 PM
class Foo<T> where T: Comparable<T>, T: CharSequence (val t: T)
doesn't work
s

Sam

02/16/2023, 3:38 PM
Did you try this?
Copy code
class Foo<T>(val t: T) where T: Comparable<T>, T: CharSequence
r

robstoll

02/16/2023, 3:38 PM
but
class Foo<T> (val t: T) where T: Comparable<T>, T: CharSequence
does, I could swear before it didn't
s

Sam

02/16/2023, 3:38 PM
Gremlins probably
r

robstoll

02/16/2023, 3:38 PM
most likely, I expected it to be after
()
anyway. thanks 🙂