File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -626,11 +626,13 @@ object Inferencing {
626626 case tp : RecType => tp.derivedRecType(captureWildcards(tp.parent))
627627 case tp : LazyRef => captureWildcards(tp.ref)
628628 case tp : AnnotatedType => tp.derivedAnnotatedType(captureWildcards(tp.parent), tp.annot)
629+ case tp : FlexibleType => tp.derivedFlexibleType(captureWildcards(tp.hi))
629630 case _ => tp
630631 }
631632
632633 def hasCaptureConversionArg (tp : Type )(using Context ): Boolean = tp match
633634 case tp : AppliedType => tp.args.exists(_.typeSymbol == defn.TypeBox_CAP )
635+ case tp : FlexibleType => hasCaptureConversionArg(tp.hi)
634636 case _ => false
635637}
636638
Original file line number Diff line number Diff line change 1+ import java .util .stream ._
2+
3+ def test =
4+ val seqStream : Stream [String ] = ???
5+ val shouldNotNPE = seqStream.collect(Collectors .toList())
6+ val shouldNotNPE2 = seqStream.collect(Collectors .toList[String ]())
You can’t perform that action at this time.
0 commit comments