Skip to content

Commit 1d26443

Browse files
committed
Fix #5188: See through annotations when computing argument types.
See through annotations (and typevars) when computing argument types.
1 parent bb6a6cb commit 1d26443

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ class TypeApplications(val self: Type) extends AnyVal {
461461
* otherwise return Nil.
462462
* Existential types in arguments are returned as TypeBounds instances.
463463
*/
464-
final def argInfos(implicit ctx: Context): List[Type] = self match {
464+
final def argInfos(implicit ctx: Context): List[Type] = self.stripTypeVar.stripAnnots match {
465465
case AppliedType(tycon, args) => args
466466
case _ => Nil
467467
}

tests/pos/i5188.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
object Test {
2+
inline def sum(inline args: Int*): Int = 0
3+
sum(1, 2, 3)
4+
}

0 commit comments

Comments
 (0)