Skip to content

Commit 4a97233

Browse files
committed
Update tests
1 parent 62ef34a commit 4a97233

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

compiler/src/dotty/tools/dotc/reporting/messages.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3106,12 +3106,12 @@ extends SyntaxMsg(InlineGivenShouldNotBeFunctionID):
31063106

31073107
class InlinedAnonClassWarning()(using Context)
31083108
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."""
31153115

31163116
class ValueDiscarding(tp: Type)(using Context)
31173117
extends Message(ValueDiscardingID):

tests/pos/not-looping-implicit.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ object Schema {
2424
inline summonInline[Mirror.Of[A]] match {
2525
case m: Mirror.SumOf[A] =>
2626
lazy val members = recurse[m.MirroredElemLabels, m.MirroredElemTypes]()
27-
class InlinedSchema extends Schema[A] {} // avoid inline anon class warning
28-
new InlinedSchema
27+
???
2928
case m: Mirror.ProductOf[A] =>
3029
lazy val fields = recurse[m.MirroredElemLabels, m.MirroredElemTypes]()
31-
class InlinedSchema2 extends Schema[A] {} // avoid inline anon class warning
32-
new InlinedSchema2
30+
???
3331
}
3432

3533
inline given gen[A]: Schema[A] = derived[A]

tests/warn/i16723.check

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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`

tests/warn/i16723a.check

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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`

0 commit comments

Comments
 (0)