File tree 3 files changed +30
-1
lines changed
compiler/src/dotty/tools/dotc/typer
3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ object Applications {
333
333
// it's crucial that the type tree is not copied directly as argument to
334
334
// `cpy$default$1`. If it was, the variable `X'` would already be interpolated
335
335
// when typing the default argument, which is too early.
336
- spliceMeth(meth, fn).appliedToTypes (targs.tpes )
336
+ spliceMeth(meth, fn).appliedToTypeTrees (targs.map(targ => TypeTree (targ.tpe).withSpan(targ.span)) )
337
337
case _ => meth
338
338
}
339
339
Original file line number Diff line number Diff line change
1
+ import compiletime .ops .int .Max
2
+
3
+ trait DFSInt [W <: Int ]
4
+ trait Candidate [R ]:
5
+ type OutW <: Int
6
+ object Candidate :
7
+ given [W <: Int , R <: DFSInt [W ]]: Candidate [R ] with
8
+ type OutW = W
9
+
10
+ def foo [R ](rhs : R )(using icR : Candidate [R ]): DFSInt [Max [8 , icR.OutW ]] = ???
11
+
12
+ object Test :
13
+ def check [A ](a : A , clue : Int = 1 ): Unit = ???
14
+ val x : DFSInt [8 ] = ???
15
+ check(foo(x))
Original file line number Diff line number Diff line change
1
+ import scala .compiletime .ops .int .Max
2
+
3
+ trait Foo [A ]
4
+ trait Bar [B ]:
5
+ type Out <: Int
6
+ object Bar :
7
+ given inst [C <: Int ]: Bar [C ] with
8
+ type Out = C
9
+
10
+ class Test :
11
+ def mkFoo (using bx : Bar [2 ]): Foo [Max [1 , bx.Out ]] = ???
12
+ def check [Y ](yy : Y , clue : Int = 1 ): Unit = ()
13
+
14
+ def test : Unit = check(mkFoo)
You can’t perform that action at this time.
0 commit comments