@@ -9,15 +9,15 @@ import config.SourceVersion
9
9
import ast ._
10
10
import config .Feature .sourceVersion
11
11
import java .lang .System .currentTimeMillis
12
-
12
+ import language . experimental . pureFunctions
13
13
14
14
object report :
15
15
16
16
/** For sending messages that are printed only if -verbose is set */
17
- def inform (msg : = > String , pos : SrcPos = NoSourcePosition )(using Context ): Unit =
17
+ def inform (msg : - > String , pos : SrcPos = NoSourcePosition )(using Context ): Unit =
18
18
if ctx.settings.verbose.value then echo(msg, pos)
19
19
20
- def echo (msg : = > String , pos : SrcPos = NoSourcePosition )(using Context ): Unit =
20
+ def echo (msg : - > String , pos : SrcPos = NoSourcePosition )(using Context ): Unit =
21
21
ctx.reporter.report(new Info (msg.toMessage, pos.sourcePos))
22
22
23
23
private def issueWarning (warning : Warning )(using Context ): Unit =
@@ -26,28 +26,28 @@ object report:
26
26
def deprecationWarning (msg : Message , pos : SrcPos )(using Context ): Unit =
27
27
issueWarning(new DeprecationWarning (msg, pos.sourcePos))
28
28
29
- def deprecationWarning (msg : = > String , pos : SrcPos )(using Context ): Unit =
29
+ def deprecationWarning (msg : - > String , pos : SrcPos )(using Context ): Unit =
30
30
deprecationWarning(msg.toMessage, pos)
31
31
32
32
def migrationWarning (msg : Message , pos : SrcPos )(using Context ): Unit =
33
33
issueWarning(new MigrationWarning (msg, pos.sourcePos))
34
34
35
- def migrationWarning (msg : = > String , pos : SrcPos )(using Context ): Unit =
35
+ def migrationWarning (msg : - > String , pos : SrcPos )(using Context ): Unit =
36
36
migrationWarning(msg.toMessage, pos)
37
37
38
38
def uncheckedWarning (msg : Message , pos : SrcPos )(using Context ): Unit =
39
39
issueWarning(new UncheckedWarning (msg, pos.sourcePos))
40
40
41
- def uncheckedWarning (msg : = > String , pos : SrcPos )(using Context ): Unit =
41
+ def uncheckedWarning (msg : - > String , pos : SrcPos )(using Context ): Unit =
42
42
uncheckedWarning(msg.toMessage, pos)
43
43
44
44
def featureWarning (msg : Message , pos : SrcPos )(using Context ): Unit =
45
45
issueWarning(new FeatureWarning (msg, pos.sourcePos))
46
46
47
- def featureWarning (msg : = > String , pos : SrcPos )(using Context ): Unit =
47
+ def featureWarning (msg : - > String , pos : SrcPos )(using Context ): Unit =
48
48
featureWarning(msg.toMessage, pos)
49
49
50
- def featureWarning (feature : String , featureDescription : = > String ,
50
+ def featureWarning (feature : String , featureDescription : - > String ,
51
51
featureUseSite : Symbol , required : Boolean , pos : SrcPos )(using Context ): Unit = {
52
52
val req = if (required) " needs to" else " should"
53
53
val fqname = s " scala.language. $feature"
@@ -70,15 +70,15 @@ object report:
70
70
def warning (msg : Message , pos : SrcPos )(using Context ): Unit =
71
71
issueWarning(new Warning (msg, addInlineds(pos)))
72
72
73
- def warning (msg : = > String , pos : SrcPos = NoSourcePosition )(using Context ): Unit =
73
+ def warning (msg : - > String , pos : SrcPos = NoSourcePosition )(using Context ): Unit =
74
74
warning(msg.toMessage, pos)
75
75
76
76
def error (msg : Message , pos : SrcPos )(using Context ): Unit =
77
77
val fullPos = addInlineds(pos)
78
78
ctx.reporter.report(new Error (msg, fullPos))
79
79
if ctx.settings.YdebugError .value then Thread .dumpStack()
80
80
81
- def error (msg : = > String , pos : SrcPos = NoSourcePosition )(using Context ): Unit =
81
+ def error (msg : - > String , pos : SrcPos = NoSourcePosition )(using Context ): Unit =
82
82
error(msg.toMessage, pos)
83
83
84
84
def error (ex : TypeError , pos : SrcPos )(using Context ): Unit =
@@ -91,14 +91,14 @@ object report:
91
91
if sourceVersion.isMigrating && sourceVersion.ordinal <= from.ordinal then migrationWarning(msg, pos)
92
92
else error(msg, pos)
93
93
94
- def errorOrMigrationWarning (msg : = > String , pos : SrcPos , from : SourceVersion )(using Context ): Unit =
94
+ def errorOrMigrationWarning (msg : - > String , pos : SrcPos , from : SourceVersion )(using Context ): Unit =
95
95
errorOrMigrationWarning(msg.toMessage, pos, from)
96
96
97
97
def gradualErrorOrMigrationWarning (msg : Message , pos : SrcPos , warnFrom : SourceVersion , errorFrom : SourceVersion )(using Context ): Unit =
98
98
if sourceVersion.isAtLeast(errorFrom) then errorOrMigrationWarning(msg, pos, errorFrom)
99
99
else if sourceVersion.isAtLeast(warnFrom) then warning(msg, pos)
100
100
101
- def gradualErrorOrMigrationWarning (msg : = > String , pos : SrcPos , warnFrom : SourceVersion , errorFrom : SourceVersion )(using Context ): Unit =
101
+ def gradualErrorOrMigrationWarning (msg : - > String , pos : SrcPos , warnFrom : SourceVersion , errorFrom : SourceVersion )(using Context ): Unit =
102
102
gradualErrorOrMigrationWarning(msg.toMessage, pos, warnFrom, errorFrom)
103
103
104
104
def restrictionError (msg : Message , pos : SrcPos = NoSourcePosition )(using Context ): Unit =
@@ -111,27 +111,27 @@ object report:
111
111
* See [[config.CompilerCommand#explainAdvanced ]] for the exact meaning of
112
112
* "contains" here.
113
113
*/
114
- def log (msg : = > String , pos : SrcPos = NoSourcePosition )(using Context ): Unit =
114
+ def log (msg : - > String , pos : SrcPos = NoSourcePosition )(using Context ): Unit =
115
115
if (ctx.settings.Ylog .value.containsPhase(ctx.phase))
116
116
echo(s " [log ${ctx.phase}] $msg" , pos)
117
117
118
- def debuglog (msg : = > String )(using Context ): Unit =
118
+ def debuglog (msg : - > String )(using Context ): Unit =
119
119
if (ctx.debug) log(msg)
120
120
121
- def informTime (msg : = > String , start : Long )(using Context ): Unit = {
121
+ def informTime (msg : - > String , start : Long )(using Context ): Unit = {
122
122
def elapsed = s " in ${currentTimeMillis - start}ms "
123
123
informProgress(msg + elapsed)
124
124
}
125
125
126
- def informProgress (msg : = > String )(using Context ): Unit =
126
+ def informProgress (msg : - > String )(using Context ): Unit =
127
127
inform(" [" + msg + " ]" )
128
128
129
- def logWith [T ](msg : = > String )(value : T )(using Context ): T = {
129
+ def logWith [T ](msg : - > String )(value : T )(using Context ): T = {
130
130
log(msg + " " + value)
131
131
value
132
132
}
133
133
134
- def debugwarn (msg : = > String , pos : SrcPos = NoSourcePosition )(using Context ): Unit =
134
+ def debugwarn (msg : - > String , pos : SrcPos = NoSourcePosition )(using Context ): Unit =
135
135
if (ctx.settings.Ydebug .value) warning(msg, pos)
136
136
137
137
private def addInlineds (pos : SrcPos )(using Context ): SourcePosition =
0 commit comments