File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -541,6 +541,9 @@ object Checking {
541
541
checkCombination(Abstract , Override )
542
542
checkCombination(Private , Override )
543
543
checkCombination(Lazy , Inline )
544
+ // The issue with `erased inline` is that the erased semantics get lost
545
+ // as the code is inlined and the reference is removed before the erased usage check.
546
+ checkCombination(Erased , Inline )
544
547
checkNoConflict(Lazy , ParamAccessor , s " parameter may not be `lazy` " )
545
548
}
546
549
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ object Boom {
2
2
import scala .compiletime .*
3
3
trait Fail [A <: Int , B <: Int ]
4
4
5
- erased transparent inline given fail [X <: Int , Y <: Int ]: Fail [X , Y ] = {
5
+ transparent inline given fail [X <: Int , Y <: Int ]: Fail [X , Y ] = {
6
6
scala.compiletime.summonFrom {
7
7
case t : Fail [X , y] if constValue[y] < constValue[Y ] => ???
8
8
}
@@ -12,4 +12,4 @@ object Boom {
12
12
given ev1 : Fail [a.type , 2 ] = null
13
13
14
14
summon[Fail [a.type , 3 ]]
15
- }
15
+ }
Original file line number Diff line number Diff line change
1
+ import language .experimental .erasedDefinitions
2
+
3
+ erased inline def f : Unit = () // error: illegal combination of modifiers: `erased` and `inline` for: method f
4
+ inline def g : Unit = ()
You can’t perform that action at this time.
0 commit comments