Is there a way to declare in a base class that a f...
# advent-of-code
j
Is there a way to declare in a base class that a function either takes a
List<String>
or a
Sequence<String>
and than in an override decide if you get the
List
or the
Sequence
? Or is this just overengineered and I should always take a
Sequence
?
p
I have this in my base class
Copy code
val input: Sequence<String> = // ...
val cachedInput: List<String> by lazy {
    input.toList()
}
Subclasses can use either. Both over- and under-engineered 😄
👀 2
j
Hm how do you then choose between test and real input?