Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5984,7 +5984,7 @@ object Types {
*/
def expandParam(tp: NamedType, pre: Type): Type =
tp.argForParam(pre) match {
case arg @ TypeRef(pre, _) if pre.isArgPrefixOf(arg.symbol) =>
case arg @ TypeRef(`pre`, _) if pre.isArgPrefixOf(arg.symbol) =>
arg.info match {
case argInfo: TypeBounds => expandBounds(argInfo)
case argInfo => useAlternate(arg)
Expand Down
15 changes: 15 additions & 0 deletions tests/pos/i19354.orig.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import javax.annotation.processing.{ AbstractProcessor, RoundEnvironment }
import javax.lang.model.element.{ ElementKind, PackageElement, TypeElement }

import java.util as ju

class P extends AbstractProcessor {
override def process(annotations: ju.Set[? <: TypeElement], roundEnv: RoundEnvironment): Boolean = {
annotations
.stream()
.flatMap(annotation => roundEnv.getElementsAnnotatedWith(annotation).stream())
.filter(element => element.getKind == ElementKind.PACKAGE)
.map(element => element.asInstanceOf[PackageElement])
true
}
}
7 changes: 7 additions & 0 deletions tests/pos/i19354.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Foo; class Bar
class Test:
def t1(xs: java.util.stream.Stream[? <: Foo]) =
xs.map(x => take(x))

def take(x: Foo) = ""
def take(x: Bar) = ""