File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
compiler/src/dotty/tools/dotc/reporting Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ trait Reporting { this: Context =>
37
37
def echo (msg : => String , pos : SourcePosition = NoSourcePosition ): Unit =
38
38
reporter.report(new Info (msg, pos))
39
39
40
- def reportWarning (warning: Warning ): Unit =
41
- if (this .settings.XfatalWarnings .value) error (warning.contained, warning.pos )
40
+ def reportWarning (warning : Warning ): Unit =
41
+ if (this .settings.XfatalWarnings .value) reporter.report (warning.toError )
42
42
else reporter.report(warning)
43
43
44
44
def deprecationWarning (msg : => Message , pos : SourcePosition = NoSourcePosition ): Unit =
Original file line number Diff line number Diff line change @@ -31,7 +31,9 @@ object messages {
31
31
class Warning (
32
32
msgFn : => Message ,
33
33
pos : SourcePosition
34
- ) extends MessageContainer (msgFn, pos, WARNING )
34
+ ) extends MessageContainer (msgFn, pos, WARNING ) {
35
+ def toError : Error = new Error (msgFn, pos)
36
+ }
35
37
36
38
class Info (
37
39
msgFn : => Message ,
You can’t perform that action at this time.
0 commit comments