Skip to content

Commit c2b5062

Browse files
committed
Fix type aliases in beta-reduction of polyfunctions
Fixes #17052
1 parent e422066 commit c2b5062

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/transform/BetaReduce.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ object BetaReduce:
117117
case ref @ TypeRef(NoPrefix, _) =>
118118
ref.symbol
119119
case _ =>
120-
val binding = TypeDef(newSymbol(ctx.owner, tparam.name, EmptyFlags, targ.tpe, coord = targ.span)).withSpan(targ.span)
120+
val binding = TypeDef(newSymbol(ctx.owner, tparam.name, EmptyFlags, TypeAlias(targ.tpe), coord = targ.span)).withSpan(targ.span)
121121
bindings += binding
122122
binding.symbol
123123

tests/pos/i17052.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test[F[_]](fAny: F[Any]) =
2+
{ [X] => (fx: F[X]) => { val fx2: F[X] = fx; () } }.apply[Any](fAny)

0 commit comments

Comments
 (0)