File tree 2 files changed +8
-4
lines changed
compiler/src/dotty/tools/dotc/core
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -947,8 +947,11 @@ object Types {
947
947
final def possibleSamMethods (using Context ): Seq [SingleDenotation ] = {
948
948
record(" possibleSamMethods" )
949
949
atPhaseNoLater(erasurePhase) {
950
- abstractTermMembers.toList.filterConserve(m =>
951
- ! m.symbol.matchingMember(defn.ObjectType ).exists && ! m.symbol.isSuperAccessor)
950
+ abstractTermMembers.toList.filterConserve { m =>
951
+ ! m.symbol.matchingMember(defn.ObjectType ).exists
952
+ && ! m.symbol.isSuperAccessor
953
+ && ! m.symbol.isInlineMethod
954
+ }
952
955
}.map(_.current)
953
956
}
954
957
@@ -5353,6 +5356,7 @@ object Types {
5353
5356
*
5354
5357
* - has a single abstract method with a method type (ExprType
5355
5358
* and PolyType not allowed!) whose result type is not an implicit function type
5359
+ * and which is not marked inline.
5356
5360
* - can be instantiated without arguments or with just () as argument.
5357
5361
*
5358
5362
* The pattern `SAMType(sam)` matches a SAM type, where `sam` is the
Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ import Noop.*
10
10
11
11
final case class User (name : String , age : Int )
12
12
13
- inline given Noop [User ] = a => a
13
+ inline given Noop [User ] = a => a // error
14
14
15
15
val u = User (" hello" , 45 )
16
16
17
17
@ main
18
- def run = println(Noop .noop(u)) // error
18
+ def run = println(Noop .noop(u))
You can’t perform that action at this time.
0 commit comments