File tree Expand file tree Collapse file tree 3 files changed +9
-16
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ abstract class Reporter extends interfaces.ReporterResult {
230230 ctx.mode.is(Mode .Printing )
231231
232232 /** Does this reporter contain not yet reported errors or warnings? */
233- def hasPending ( implicit ctx : Context ) : Boolean = false
233+ def hasPendingErrors : Boolean = false
234234
235235 /** If this reporter buffers messages, remove and return all buffered messages. */
236236 def removeBufferedMessages (implicit ctx : Context ): List [MessageContainer ] = Nil
Original file line number Diff line number Diff line change @@ -30,14 +30,8 @@ class StoreReporter(outer: Reporter) extends Reporter {
3030 infos += m
3131 }
3232
33- override def hasPending (implicit ctx : Context ): Boolean = infos != null && {
34- infos exists {
35- case _ : Error => true
36- case m : ConditionalWarning => m.enablingOption.value
37- case _ : Warning => true
38- case _ => false
39- }
40- }
33+ override def hasPendingErrors : Boolean =
34+ infos != null && infos.exists(_.isInstanceOf [Error ])
4135
4236 override def removeBufferedMessages (implicit ctx : Context ): List [MessageContainer ] =
4337 if (infos != null ) try infos.toList finally infos = null
Original file line number Diff line number Diff line change @@ -249,13 +249,12 @@ object ProtoTypes {
249249 targ = arg.withType(WildcardType )
250250 else {
251251 targ = typerFn(arg)
252- if (! ctx.reporter.hasPending) {
253- // There is something fishy going on. Run pos/t1756.scala with -feature.
254- // You will get an orphan type parameter for CI when pickling.
255- // The difference is that with -feature an `implicitConversions` warning
256- // is issued, which means the next two statements are not executed.
257- // It seems we are missing then some constraint instantiations because `evalState`
258- // is not updated.
252+ if (! ctx.reporter.hasPendingErrors) {
253+ // FIXME: This can swallow warnings by updating the typerstate from a nested
254+ // context that gets discarded later. But we do have to update the
255+ // typerstate if there are no errors. If we also omitted the next two lines
256+ // when warning were emitted, `pos/t1756.scala` would fail when run with -feature.
257+ // It would produce an orphan type parameter for CI when pickling.
259258 myTypedArg = myTypedArg.updated(arg, targ)
260259 evalState = evalState.updated(arg, (ctx.typerState, ctx.typerState.constraint))
261260 }
You can’t perform that action at this time.
0 commit comments