File tree 4 files changed +20
-10
lines changed
compiler/src/dotty/tools/dotc/reporting
4 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -3106,12 +3106,12 @@ extends SyntaxMsg(InlineGivenShouldNotBeFunctionID):
3106
3106
3107
3107
class InlinedAnonClassWarning ()(using Context )
3108
3108
extends Message (InlinedAnonClassWarningID ):
3109
- def kind = MessageKind .PotentialIssue
3110
- def msg (using Context ) = " New anonymous class definition will be duplicated at each inline site"
3111
- def explain (using Context ) =
3112
- i """ Anonymous class will be defined at each use site, which may lead to a larger number of classfiles.
3113
- |
3114
- |To inline class definitions, you may provide an explicit class name to avoid this warning. """
3109
+ def kind = MessageKind .PotentialIssue
3110
+ def msg (using Context ) = " New anonymous class definition will be duplicated at each inline site"
3111
+ def explain (using Context ) =
3112
+ i """ Anonymous class will be defined at each use site, which may lead to a larger number of classfiles.
3113
+ |
3114
+ |To inline class definitions, you may provide an explicit class name to avoid this warning. """
3115
3115
3116
3116
class ValueDiscarding (tp : Type )(using Context )
3117
3117
extends Message (ValueDiscardingID ):
Original file line number Diff line number Diff line change @@ -24,12 +24,10 @@ object Schema {
24
24
inline summonInline[Mirror .Of [A ]] match {
25
25
case m : Mirror .SumOf [A ] =>
26
26
lazy val members = recurse[m.MirroredElemLabels , m.MirroredElemTypes ]()
27
- class InlinedSchema extends Schema [A ] {} // avoid inline anon class warning
28
- new InlinedSchema
27
+ ???
29
28
case m : Mirror .ProductOf [A ] =>
30
29
lazy val fields = recurse[m.MirroredElemLabels , m.MirroredElemTypes ]()
31
- class InlinedSchema2 extends Schema [A ] {} // avoid inline anon class warning
32
- new InlinedSchema2
30
+ ???
33
31
}
34
32
35
33
inline given gen [A ]: Schema [A ] = derived[A ]
Original file line number Diff line number Diff line change
1
+ -- [E195] Potential Issue Warning: tests/warn/i16723.scala:3:2 ---------------------------------------------------------
2
+ 3 | new Object {} // warn
3
+ | ^
4
+ | New anonymous class definition will be duplicated at each inline site
5
+ |
6
+ | longer explanation available when compiling with `-explain`
Original file line number Diff line number Diff line change
1
+ -- [E195] Potential Issue Warning: tests/warn/i16723a.scala:5:38 -------------------------------------------------------
2
+ 5 |inline given Converter[Int, String] = new Converter { // warn
3
+ | ^
4
+ | New anonymous class definition will be duplicated at each inline site
5
+ |
6
+ | longer explanation available when compiling with `-explain`
You can’t perform that action at this time.
0 commit comments