0c03458717
Reland of https://dart-review.googlesource.com/c/sdk/+/29160 Adds a 'severity' field to diagnostic messages and replaces all addWarning and addNit functions by a generic addProblem, which uses the intrinsic severity of the message. Eventually, errors should also be reported this way. A special severity value maps into either warning or error for Dart 1 and Dart 2, respectively. Most Dart 1 warnings are in this category. Fixes some 320 failures of DDK test expecting a compile-time error. These were previously masked by a workaround in the DDC error handler which has now been removed. Closes https://github.com/dart-lang/sdk/issues/31286 Change-Id: Id3b3b7f1fc6a101639fc908c90f3ec7d304a7b4b Reviewed-on: https://dart-review.googlesource.com/32580 Commit-Queue: Aske Simon Christensen <askesc@google.com> Reviewed-by: Paul Berry <paulberry@google.com>
33 lines
980 B
Dart
33 lines
980 B
Dart
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
/*@testedFeatures=inference,error*/
|
|
library test;
|
|
|
|
// All of these cases are error conditions; this test checks how we recover.
|
|
|
|
abstract class A {
|
|
int f(int x, int y);
|
|
int g(int x, [int y]);
|
|
int h(int x, {int y});
|
|
}
|
|
|
|
abstract class B {
|
|
int f(int x);
|
|
int g(int x);
|
|
int h(int x);
|
|
}
|
|
|
|
abstract class C implements A, B {
|
|
/*@topType=int*/ /*@error=OverrideMoreRequiredArguments*/ f(
|
|
/*@topType=int*/ x,
|
|
/*@topType=dynamic*/ /*@error=CantInferTypeDueToInconsistentOverrides*/ y);
|
|
/*@topType=int*/ g(/*@topType=int*/ x,
|
|
[/*@topType=dynamic*/ /*@error=CantInferTypeDueToInconsistentOverrides*/ y]);
|
|
/*@topType=int*/ h(/*@topType=int*/ x,
|
|
{/*@topType=dynamic*/ /*@error=CantInferTypeDueToInconsistentOverrides*/ y});
|
|
}
|
|
|
|
main() {}
|