Skip to content

Commit 7e1c4ca

Browse files
committed
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.
1 parent 4c2305d commit 7e1c4ca

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
@@ -689,7 +689,8 @@ object SymDenotations {
689689
final def isAbstractType(using Context): Boolean = this.is(DeferredType)
690690

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

694695
/** Is this symbol an abstract or alias type? */
695696
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)