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 {
541541 checkCombination(Abstract , Override )
542542 checkCombination(Private , Override )
543543 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 )
544547 checkNoConflict(Lazy , ParamAccessor , s " parameter may not be `lazy` " )
545548 }
546549
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ object Boom {
22 import scala .compiletime .*
33 trait Fail [A <: Int , B <: Int ]
44
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 ] = {
66 scala.compiletime.summonFrom {
77 case t : Fail [X , y] if constValue[y] < constValue[Y ] => ???
88 }
@@ -12,4 +12,4 @@ object Boom {
1212 given ev1 : Fail [a.type , 2 ] = null
1313
1414 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