Skip to content

Commit d2f07d9

Browse files
oderskyWojciechMazur
authored andcommitted
Fix isAliasType
Symbols that had the TypeParam flag set were classified as alias types unless they also had the Deferred flag set. Maybe this did not break that much since Namer always added the Deferred for type parameters. But export forwarders use synthesized parameters which did not have Deferred set. [Cherry-picked 7e1c4ca]
1 parent 5e1d1b5 commit d2f07d9

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,8 @@ object SymDenotations {
688688
final def isAbstractType(using Context): Boolean = this.is(DeferredType)
689689

690690
/** Is this symbol an alias type? */
691-
final def isAliasType(using Context): Boolean = isAbstractOrAliasType && !this.is(Deferred)
691+
final def isAliasType(using Context): Boolean =
692+
isAbstractOrAliasType && !isAbstractOrParamType
692693

693694
/** Is this symbol an abstract or alias type? */
694695
final def isAbstractOrAliasType: Boolean = isType & !isClass

tests/neg/i20079/Lib_1.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
object Foo:
2+
def xyz[A, CC[X] <: Iterable[X]](coll: CC[A]): Unit = ()
3+
4+
object Bar:
5+
export Foo.xyz

tests/neg/i20079/Test_2.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
object Test:
2+
val ints = List(1)
3+
Foo.xyz[Int, List](ints)
4+
Foo.xyz[Int, scala.collection.View](ints) // error
5+
Bar.xyz[Int, List](ints)
6+
Bar.xyz[Int, scala.collection.View](ints) // error

0 commit comments

Comments
 (0)