Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumKotlingenerics variance in outSingle-choice MCQ

Which use of a declaration-site out type parameter is rejected by the compiler?

interface Source<out T> { fun next(): T // (1) return position fun peek(): T? // (2) nullable return fun feed(item: T) // (3) parameter position val current: T // (4) val property type }