mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:36:59 +00:00
[CFE] Enable textual outline sorting in test suite
Change-Id: Iccf35b9cb3dce96487ca9ba688394e3b05be2e75 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145401 Reviewed-by: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
parent
b1435ec38a
commit
c08bcbb25e
|
@ -346,7 +346,8 @@ String _textualizeClass(TextualOutlineListener listener, Token beginToken,
|
|||
|
||||
main(List<String> args) {
|
||||
File f = new File(args[0]);
|
||||
String outline = textualOutline(f.readAsBytesSync(), throwOnUnexpected: true);
|
||||
String outline = textualOutline(f.readAsBytesSync(),
|
||||
throwOnUnexpected: true, performModelling: true);
|
||||
if (args.length > 1 && args[1] == "--overwrite") {
|
||||
f.writeAsStringSync(outline);
|
||||
} else {
|
||||
|
@ -408,9 +409,9 @@ class TextualOutlineListener extends DirectiveListener {
|
|||
elementStartToFinish[typedefKeyword] = endToken;
|
||||
}
|
||||
|
||||
// void endEnum(Token enumKeyword, Token leftBrace, int count) {
|
||||
// elementStartToFinish[enumKeyword] = leftBrace.endGroup;
|
||||
// }
|
||||
void endEnum(Token enumKeyword, Token leftBrace, int count) {
|
||||
elementStartToFinish[enumKeyword] = leftBrace.endGroup;
|
||||
}
|
||||
|
||||
// @override
|
||||
// void endLibraryName(Token libraryKeyword, Token semicolon) {
|
||||
|
|
|
@ -70,38 +70,46 @@ class TextualOutline extends Step<TestDescription, TestDescription, Context> {
|
|||
Future<Result<TestDescription>> run(
|
||||
TestDescription description, Context context) async {
|
||||
List<int> bytes = new File.fromUri(description.uri).readAsBytesSync();
|
||||
String result = textualOutline(bytes, throwOnUnexpected: true);
|
||||
if (result == null) {
|
||||
return new Result(null, context.expectationSet["EmptyOutput"],
|
||||
description.uri, StackTrace.current);
|
||||
}
|
||||
for (bool modelled in [false, true]) {
|
||||
String result = textualOutline(bytes,
|
||||
throwOnUnexpected: true, performModelling: modelled);
|
||||
if (result == null) {
|
||||
return new Result(null, context.expectationSet["EmptyOutput"],
|
||||
description.uri, StackTrace.current);
|
||||
}
|
||||
|
||||
// In an attempt to make it less sensitive to formatting first remove excess
|
||||
// new lines, then format.
|
||||
List<String> lines = result.split("\n");
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (String line in lines) {
|
||||
if (line.trim() != "") sb.writeln(line);
|
||||
}
|
||||
result = sb.toString().trim();
|
||||
// In an attempt to make it less sensitive to formatting first remove
|
||||
// excess new lines, then format.
|
||||
List<String> lines = result.split("\n");
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (String line in lines) {
|
||||
if (line.trim() != "") sb.writeln(line);
|
||||
}
|
||||
result = sb.toString().trim();
|
||||
|
||||
// Try to format.
|
||||
Exception formatterException;
|
||||
StackTrace formatterExceptionSt;
|
||||
try {
|
||||
result = new DartFormatter().format(result);
|
||||
} catch (e, st) {
|
||||
formatterException = e;
|
||||
formatterExceptionSt = st;
|
||||
}
|
||||
// Try to format.
|
||||
Exception formatterException;
|
||||
StackTrace formatterExceptionSt;
|
||||
try {
|
||||
result = new DartFormatter().format(result);
|
||||
} catch (e, st) {
|
||||
formatterException = e;
|
||||
formatterExceptionSt = st;
|
||||
}
|
||||
|
||||
Result expectMatch = await context.match<TestDescription>(
|
||||
".textual_outline.expect", result, description.uri, description);
|
||||
if (expectMatch.outcome != Expectation.Pass) return expectMatch;
|
||||
String filename = ".textual_outline.expect";
|
||||
if (modelled) {
|
||||
filename = ".textual_outline_modelled.expect";
|
||||
}
|
||||
|
||||
if (formatterException != null) {
|
||||
return new Result(null, context.expectationSet["FormatterCrash"],
|
||||
formatterException, formatterExceptionSt);
|
||||
Result expectMatch = await context.match<TestDescription>(
|
||||
filename, result, description.uri, description);
|
||||
if (expectMatch.outcome != Expectation.Pass) return expectMatch;
|
||||
|
||||
if (formatterException != null) {
|
||||
return new Result(null, context.expectationSet["FormatterCrash"],
|
||||
formatterException, formatterExceptionSt);
|
||||
}
|
||||
}
|
||||
|
||||
return new Result.pass(description);
|
||||
|
|
|
@ -352,6 +352,7 @@ miss
|
|||
misspelled
|
||||
mistake
|
||||
mistakes
|
||||
modelled
|
||||
month
|
||||
moo
|
||||
mx
|
||||
|
|
|
@ -74,4 +74,26 @@ class A {
|
|||
}""") {
|
||||
throw "Unexpected result: $result";
|
||||
}
|
||||
|
||||
// Has space between entries.
|
||||
result = textualOutline(utf8.encode("""
|
||||
@a
|
||||
@A(2)
|
||||
typedef void F1();
|
||||
|
||||
@a
|
||||
@A(3)
|
||||
int f1, f2;
|
||||
"""), throwOnUnexpected: true, performModelling: true);
|
||||
if (result !=
|
||||
"""
|
||||
@a
|
||||
@A(2)
|
||||
typedef void F1();
|
||||
|
||||
@a
|
||||
@A(3)
|
||||
int f1, f2;""") {
|
||||
throw "Unexpected result: $result";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
const a = <int>[];
|
||||
const b = <int?>[];
|
||||
const c = identical(a, b);
|
||||
main() {}
|
|
@ -0,0 +1,4 @@
|
|||
const a = <int>[];
|
||||
const b = <int?>[];
|
||||
const c = {a: 0, b: 1};
|
||||
main() {}
|
|
@ -0,0 +1,4 @@
|
|||
const a = <int>[];
|
||||
const b = <int?>[];
|
||||
const c = {a, b};
|
||||
main() {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'deferred_explicit_access_lib.dart' deferred as prefix;
|
||||
|
||||
expect(expected, actual) {}
|
||||
main() async {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'deferred_explicit_access_lib.dart' deferred as prefix hide Extension;
|
||||
|
||||
expect(expected, actual) {}
|
||||
main() async {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'export_twice_lib1.dart';
|
||||
import 'export_twice_lib2.dart';
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'import_via_prefix_lib.dart' as prefix;
|
||||
|
||||
expect(expected, actual) {}
|
||||
main() {}
|
|
@ -0,0 +1,5 @@
|
|||
import 'issue38750_lib1.dart';
|
||||
import 'issue38750_lib2.dart';
|
||||
|
||||
errors() {}
|
||||
main() {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'issue39938_lib.dart';
|
||||
|
||||
expect(expected, actual) {}
|
||||
main() {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'private_members_lib.dart';
|
||||
|
||||
errors() {}
|
||||
main() {}
|
|
@ -0,0 +1,151 @@
|
|||
Planner planner;
|
||||
|
||||
abstract class BinaryConstraint extends Constraint {
|
||||
BinaryConstraint(this.v1, this.v2, Strength strength) : super(strength) {}
|
||||
Variable input() => direction == FORWARD ? v1 : v2;
|
||||
Variable output() => direction == FORWARD ? v2 : v1;
|
||||
Variable v1;
|
||||
Variable v2;
|
||||
bool inputsKnown(int mark) {}
|
||||
bool isSatisfied() => direction != NONE;
|
||||
int direction = NONE;
|
||||
void addToGraph() {}
|
||||
void chooseMethod(int mark) {}
|
||||
void markInputs(int mark) {}
|
||||
void markUnsatisfied() {}
|
||||
void recalculate() {}
|
||||
void removeFromGraph() {}
|
||||
}
|
||||
|
||||
abstract class Constraint {
|
||||
Constraint satisfy(mark) {}
|
||||
Variable output();
|
||||
bool inputsKnown(int mark);
|
||||
bool isInput() => false;
|
||||
bool isSatisfied();
|
||||
const Constraint(this.strength);
|
||||
final Strength strength;
|
||||
void addConstraint() {}
|
||||
void addToGraph();
|
||||
void chooseMethod(int mark);
|
||||
void destroyConstraint() {}
|
||||
void execute();
|
||||
void markInputs(int mark);
|
||||
void markUnsatisfied();
|
||||
void recalculate();
|
||||
void removeFromGraph();
|
||||
}
|
||||
|
||||
abstract class UnaryConstraint extends Constraint {
|
||||
UnaryConstraint(this.myOutput, Strength strength) : super(strength) {}
|
||||
Variable output() => myOutput;
|
||||
bool inputsKnown(int mark) => true;
|
||||
bool isSatisfied() => satisfied;
|
||||
bool satisfied = false;
|
||||
final Variable myOutput;
|
||||
void addToGraph() {}
|
||||
void chooseMethod(int mark) {}
|
||||
void markInputs(int mark) {}
|
||||
void markUnsatisfied() {}
|
||||
void recalculate() {}
|
||||
void removeFromGraph() {}
|
||||
}
|
||||
|
||||
class DeltaBlue {
|
||||
void run() {}
|
||||
}
|
||||
|
||||
class EditConstraint extends UnaryConstraint {
|
||||
EditConstraint(Variable v, Strength str) : super(v, str);
|
||||
bool isInput() => true;
|
||||
void execute() {}
|
||||
}
|
||||
|
||||
class EqualityConstraint extends BinaryConstraint {
|
||||
EqualityConstraint(Variable v1, Variable v2, Strength strength)
|
||||
: super(v1, v2, strength);
|
||||
void execute() {}
|
||||
}
|
||||
|
||||
class Plan {
|
||||
List<Constraint> list = <Constraint>[];
|
||||
int size() => list.length;
|
||||
void addConstraint(Constraint c) {}
|
||||
void execute() {}
|
||||
}
|
||||
|
||||
class Planner {
|
||||
List<Constraint> removePropagateFrom(Variable out) {}
|
||||
Plan extractPlanFromConstraints(List<Constraint> constraints) {}
|
||||
Plan makePlan(List<Constraint> sources) {}
|
||||
bool addPropagate(Constraint c, int mark) {}
|
||||
int currentMark = 0;
|
||||
int newMark() => ++currentMark;
|
||||
void addConstraintsConsumingTo(Variable v, List<Constraint> coll) {}
|
||||
void incrementalAdd(Constraint c) {}
|
||||
void incrementalRemove(Constraint c) {}
|
||||
}
|
||||
|
||||
class ScaleConstraint extends BinaryConstraint {
|
||||
ScaleConstraint(
|
||||
Variable src, this.scale, this.offset, Variable dest, Strength strength)
|
||||
: super(src, dest, strength);
|
||||
final Variable offset;
|
||||
final Variable scale;
|
||||
void addToGraph() {}
|
||||
void execute() {}
|
||||
void markInputs(int mark) {}
|
||||
void recalculate() {}
|
||||
void removeFromGraph() {}
|
||||
}
|
||||
|
||||
class StayConstraint extends UnaryConstraint {
|
||||
StayConstraint(Variable v, Strength str) : super(v, str);
|
||||
void execute() {}
|
||||
}
|
||||
|
||||
class Strength {
|
||||
Strength nextWeaker() => const <Strength>[
|
||||
STRONG_PREFERRED,
|
||||
PREFERRED,
|
||||
STRONG_DEFAULT,
|
||||
NORMAL,
|
||||
WEAK_DEFAULT,
|
||||
WEAKEST
|
||||
][value];
|
||||
const Strength(this.value, this.name);
|
||||
final String name;
|
||||
final int value;
|
||||
static Strength strongest(Strength s1, Strength s2) {}
|
||||
static Strength weakest(Strength s1, Strength s2) {}
|
||||
static bool stronger(Strength s1, Strength s2) {}
|
||||
static bool weaker(Strength s1, Strength s2) {}
|
||||
}
|
||||
|
||||
class Variable {
|
||||
Constraint determinedBy;
|
||||
List<Constraint> constraints = <Constraint>[];
|
||||
Strength walkStrength = WEAKEST;
|
||||
Variable(this.name, this.value);
|
||||
bool stay = true;
|
||||
final String name;
|
||||
int mark = 0;
|
||||
int value;
|
||||
void addConstraint(Constraint c) {}
|
||||
void removeConstraint(Constraint c) {}
|
||||
}
|
||||
|
||||
const NORMAL = const Strength(4, "normal");
|
||||
const PREFERRED = const Strength(2, "preferred");
|
||||
const REQUIRED = const Strength(0, "required");
|
||||
const STRONG_DEFAULT = const Strength(3, "strongDefault");
|
||||
const STRONG_PREFERRED = const Strength(1, "strongPreferred");
|
||||
const WEAKEST = const Strength(6, "weakest");
|
||||
const WEAK_DEFAULT = const Strength(5, "weakDefault");
|
||||
const int BACKWARD = 0;
|
||||
const int FORWARD = 2;
|
||||
const int NONE = 1;
|
||||
main() {}
|
||||
void chainTest(int n) {}
|
||||
void change(Variable v, int newValue) {}
|
||||
void projectionTest(int n) {}
|
|
@ -0,0 +1,80 @@
|
|||
abstract class A implements Interface1, Interface2, Interface3 {
|
||||
aMethod() {}
|
||||
abstractMethod();
|
||||
void set property1(_);
|
||||
void set property2(_);
|
||||
void set property3(_);
|
||||
}
|
||||
|
||||
abstract class B extends A {
|
||||
aMethod() {}
|
||||
bMethod() {}
|
||||
final property1 = null;
|
||||
}
|
||||
|
||||
abstract class D extends C implements Interface2 {}
|
||||
|
||||
abstract class F extends E implements Interface1 {}
|
||||
|
||||
abstract class H extends G implements Foo {}
|
||||
|
||||
abstract class J extends I implements Bar {}
|
||||
|
||||
class Bar {
|
||||
Object get foo => null;
|
||||
}
|
||||
|
||||
class C {
|
||||
void interfaceMethod1(_) {}
|
||||
}
|
||||
|
||||
class E {
|
||||
void set interfaceMethod1(_) {}
|
||||
}
|
||||
|
||||
class Foo {
|
||||
void foo() {}
|
||||
}
|
||||
|
||||
class G {
|
||||
Object get foo => null;
|
||||
}
|
||||
|
||||
class I {
|
||||
Object foo() {}
|
||||
}
|
||||
|
||||
class Interface1 {
|
||||
void interfaceMethod1() {}
|
||||
}
|
||||
|
||||
class Interface2 {
|
||||
var interfaceMethod1;
|
||||
void interfaceMethod2() {}
|
||||
}
|
||||
|
||||
class Interface3 {
|
||||
void interfaceMethod3() {}
|
||||
}
|
||||
|
||||
class MyClass extends B {
|
||||
aMethod() {}
|
||||
aaMethod() {}
|
||||
bMethod() {}
|
||||
cMethod() {}
|
||||
var property2;
|
||||
}
|
||||
|
||||
class MyMock1 extends B {
|
||||
noSuchMethod(_) => null;
|
||||
}
|
||||
|
||||
class MyMock2 extends MyMock1 {
|
||||
noSuchMethod(_);
|
||||
}
|
||||
|
||||
class MyMock3 extends B {
|
||||
noSuchMethod(_);
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,15 @@
|
|||
abstract class A {
|
||||
A foo() => null;
|
||||
}
|
||||
|
||||
abstract class B extends A {
|
||||
B foo();
|
||||
}
|
||||
|
||||
class C {
|
||||
noSuchMethod(_) => null;
|
||||
}
|
||||
|
||||
class D extends C implements B {}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,13 @@
|
|||
class C {
|
||||
testC() {}
|
||||
testD() {}
|
||||
void set onlySetter(value) {}
|
||||
}
|
||||
|
||||
class D extends C {
|
||||
String get onlySetter => "D.onlySetter called.";
|
||||
void set onlySetter(value) {}
|
||||
}
|
||||
|
||||
main() {}
|
||||
void set onlySetter(value) {}
|
|
@ -0,0 +1,2 @@
|
|||
main() {}
|
||||
typedef F<W, X, Y, Z> = X Function(Y, Z Function(Z));
|
|
@ -0,0 +1,2 @@
|
|||
export 'hello.dart' show main;
|
||||
export 'map.dart' show main;
|
|
@ -0,0 +1,14 @@
|
|||
class Fisk<T> {
|
||||
const Fisk.fisk(this.x);
|
||||
final T x;
|
||||
}
|
||||
|
||||
const int hest = 42;
|
||||
enum Foo {
|
||||
@hest
|
||||
bar,
|
||||
@Fisk.fisk(hest)
|
||||
baz,
|
||||
cafebabe,
|
||||
}
|
||||
main() {}
|
|
@ -0,0 +1,26 @@
|
|||
@a
|
||||
@A(1)
|
||||
library test;
|
||||
|
||||
@a
|
||||
@A(2)
|
||||
class C {}
|
||||
|
||||
@a
|
||||
@A(2)
|
||||
typedef void F1();
|
||||
@a
|
||||
@A(3)
|
||||
int f1, f2;
|
||||
@a
|
||||
@A(3)
|
||||
typedef F2 = void Function();
|
||||
@a
|
||||
@A(4)
|
||||
void main() {}
|
||||
|
||||
class A {
|
||||
const A(int value);
|
||||
}
|
||||
|
||||
const Object a = const Object();
|
|
@ -0,0 +1,6 @@
|
|||
const int bar = 42;
|
||||
const int baz = 84;
|
||||
const int foo = 21;
|
||||
main() {}
|
||||
typedef void F(@foo int x, num y, {@bar @baz String z, Object w});
|
||||
typedef void G(@foo int a, num b, [@bar @baz String c, Object d]);
|
|
@ -0,0 +1,3 @@
|
|||
const int app = 0;
|
||||
main() {}
|
||||
typedef int F(@app int app);
|
|
@ -0,0 +1,17 @@
|
|||
class Bar {
|
||||
const Bar();
|
||||
const Bar.named(x);
|
||||
}
|
||||
|
||||
class Baz {
|
||||
Baz(@foo constructorFormal);
|
||||
factory Baz.bazFactory(@foo factoryFormal) => null;
|
||||
fisk(@foo formal1, @Bar() formal2, @Bar.named(foo) formal3,
|
||||
@foo @Bar.named(foo) formal4,
|
||||
[@foo optional]) {}
|
||||
hest({@foo named}) => null;
|
||||
}
|
||||
|
||||
const int foo = 42;
|
||||
main() {}
|
||||
typedef hest_t({@foo named});
|
|
@ -0,0 +1,14 @@
|
|||
abstract class Base {}
|
||||
|
||||
class Bar extends Base {}
|
||||
|
||||
class Baz extends Base {}
|
||||
|
||||
class Foo extends Base {}
|
||||
|
||||
main() {}
|
||||
void bar(x) {}
|
||||
void bar_escaped(x) {}
|
||||
void escape(fn) {}
|
||||
void foo(x) {}
|
||||
void foo_escaped(x) {}
|
|
@ -0,0 +1,3 @@
|
|||
foo() {}
|
||||
main() {}
|
||||
test() {}
|
|
@ -0,0 +1,3 @@
|
|||
int foo(int x, int y) {}
|
||||
main() {}
|
||||
void loop(List xs) {}
|
|
@ -0,0 +1 @@
|
|||
main<T>() => () => T;
|
|
@ -0,0 +1,11 @@
|
|||
import "package:expect/expect.dart";
|
||||
|
||||
class A {
|
||||
A(this.x)
|
||||
: y = (() {
|
||||
x = 3;
|
||||
});
|
||||
var x, y;
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,10 @@
|
|||
import 'dart:async';
|
||||
|
||||
Future<String> asyncString() async {}
|
||||
Future<String> asyncString2() async {}
|
||||
Iterable<String> syncStarString() sync* {}
|
||||
Iterable<String> syncStarString2() sync* {}
|
||||
List<String> stringList = ["bar"];
|
||||
Stream<String> asyncStarString() async* {}
|
||||
Stream<String> asyncStarString2() async* {}
|
||||
main() async {}
|
|
@ -0,0 +1,11 @@
|
|||
import 'dart:async';
|
||||
|
||||
class Node {
|
||||
Node(this.name, [this.nested]) {}
|
||||
String toString() => '<$name:[${nested?.join(', ')}]>';
|
||||
final List<Node> nested;
|
||||
final String name;
|
||||
toSimpleString() {}
|
||||
}
|
||||
|
||||
void main() async {}
|
|
@ -0,0 +1 @@
|
|||
main() async {}
|
|
@ -0,0 +1,40 @@
|
|||
import 'dart:async';
|
||||
|
||||
FutureOr<T> future<T>(T value) async => value;
|
||||
FutureOr<T> id<T>(T value) => value;
|
||||
Stream<int> intStream() async* {}
|
||||
asserts() async {}
|
||||
|
||||
class C {
|
||||
int field = 1;
|
||||
int foo(int param) => param;
|
||||
int get getter => field;
|
||||
static int get staticGetter => staticField;
|
||||
static int staticField = 1;
|
||||
static int staticFoo(int param) => param;
|
||||
static void set staticSetter(val) {}
|
||||
void set setter(val) {}
|
||||
}
|
||||
|
||||
conditionals() async {}
|
||||
controlFlow() async {}
|
||||
dummy() => 1;
|
||||
expect(expected, actual) {}
|
||||
expectList(List expected, List actual) {}
|
||||
final bool assertStatementsEnabled = () {
|
||||
try {
|
||||
assert(false);
|
||||
return false;
|
||||
} catch (_) {
|
||||
return true;
|
||||
}
|
||||
}();
|
||||
instanceMembers() async {}
|
||||
int get topLevelGetter => globalVariable;
|
||||
int globalVariable = 1;
|
||||
int topLevelFoo(int param) => 1;
|
||||
main() async {}
|
||||
others() async {}
|
||||
staticMembers() async {}
|
||||
topLevelMembers() async {}
|
||||
void set topLevelSetter(val) {}
|
|
@ -0,0 +1,9 @@
|
|||
import 'dart:async';
|
||||
|
||||
class C {
|
||||
Future<List<int>> m() async => []..add(await _m());
|
||||
Future<int> _m() async => 42;
|
||||
}
|
||||
|
||||
expect(expected, actual) {}
|
||||
main() async {}
|
|
@ -0,0 +1,2 @@
|
|||
foo() {}
|
||||
main() {}
|
|
@ -0,0 +1,7 @@
|
|||
class Foo {
|
||||
var field;
|
||||
}
|
||||
|
||||
dynamic identity(x) => x;
|
||||
main(List<String> args) {}
|
||||
void use(x) {}
|
|
@ -0,0 +1,77 @@
|
|||
class A<T> {}
|
||||
|
||||
class B<T> extends A<Function(T)> {}
|
||||
|
||||
class Bc<T> extends A<ContravariantUse<T>> {}
|
||||
|
||||
class Bi<T> extends A<InvariantUse<T>> {}
|
||||
|
||||
class C<T> implements A<Function(T)> {}
|
||||
|
||||
class Cc<T> implements A<ContravariantUse<T>> {}
|
||||
|
||||
class Ci<T> implements A<InvariantUse<T>> {}
|
||||
|
||||
class Empty {}
|
||||
|
||||
typedef ContravariantUse<T> = Function(T);
|
||||
typedef InvariantUse<T> = T Function(T);
|
||||
class D<T> = Object with A<Function(T)>;
|
||||
class Dc<T> = Object with A<ContravariantUse<T>>;
|
||||
class Di<T> = Object with A<InvariantUse<T>>;
|
||||
class E<T> = A<Function(T)> with Empty;
|
||||
class Ec<T> = A<ContravariantUse<T>> with Empty;
|
||||
class Ei<T> = A<InvariantUse<T>> with Empty;
|
||||
|
||||
class F<T> extends Object with A<Function(T)> {}
|
||||
|
||||
class Fc<T> extends Object with A<ContravariantUse<T>> {}
|
||||
|
||||
class Fi<T> extends Object with A<InvariantUse<T>> {}
|
||||
|
||||
class G<T> extends A<Function(T)> with Empty {}
|
||||
|
||||
class Gc<T> extends A<ContravariantUse<T>> with Empty {}
|
||||
|
||||
class Gi<T> extends A<InvariantUse<T>> with Empty {}
|
||||
|
||||
class Hcc<T> extends A<ContravariantUse<ContravariantUse<T>>> {}
|
||||
|
||||
class Hcf<T> extends A<ContravariantUse<Function(T)>> {}
|
||||
|
||||
class Hfc<T> extends A<Function(ContravariantUse<T>)> {}
|
||||
|
||||
class Hff<T> extends A<Function(Function(T))> {}
|
||||
|
||||
class Hii<T> extends A<InvariantUse<InvariantUse<T>>> {}
|
||||
|
||||
class Iacf<T> extends A<A<ContravariantUse<Function(T)>>> {}
|
||||
|
||||
class Iafc<T> extends A<A<Function(ContravariantUse<T>)>> {}
|
||||
|
||||
class Icaf<T> extends A<ContravariantUse<A<Function(T)>>> {}
|
||||
|
||||
class Icfa<T> extends A<ContravariantUse<Function(A<T>)>> {}
|
||||
|
||||
class Ifac<T> extends A<Function(A<ContravariantUse<T>>)> {}
|
||||
|
||||
class Ifca<T> extends A<Function(ContravariantUse<A<T>>)> {}
|
||||
|
||||
class Jccc<T>
|
||||
extends A<ContravariantUse<ContravariantUse<ContravariantUse<T>>>> {}
|
||||
|
||||
class Jccf<T> extends A<ContravariantUse<ContravariantUse<Function(T)>>> {}
|
||||
|
||||
class Jcfc<T> extends A<ContravariantUse<Function(ContravariantUse<T>)>> {}
|
||||
|
||||
class Jcff<T> extends A<ContravariantUse<Function(Function(T))>> {}
|
||||
|
||||
class Jfcc<T> extends A<Function(ContravariantUse<ContravariantUse<T>>)> {}
|
||||
|
||||
class Jfcf<T> extends A<Function(ContravariantUse<Function(T)>)> {}
|
||||
|
||||
class Jffc<T> extends A<Function(Function(ContravariantUse<T>))> {}
|
||||
|
||||
class Jfff<T> extends A<Function(Function(Function(T)))> {}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,11 @@
|
|||
baz() {}
|
||||
|
||||
class A<X> {
|
||||
bar<Y extends X>() => null;
|
||||
}
|
||||
|
||||
class B {
|
||||
static A<Y> foo<Y extends Object>() => null;
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,2 @@
|
|||
main() {}
|
||||
test() {}
|
|
@ -0,0 +1,9 @@
|
|||
class A {
|
||||
var foo = 42;
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
foo() => 42;
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,2 @@
|
|||
void main() {}
|
||||
void test() {}
|
|
@ -0,0 +1,2 @@
|
|||
void main() {}
|
||||
void test() {}
|
|
@ -0,0 +1,9 @@
|
|||
abstract class I {
|
||||
void call();
|
||||
}
|
||||
|
||||
class C implements I {
|
||||
void call([int x]) {}
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,8 @@
|
|||
class A {
|
||||
dynamic call(dynamic a, dynamic b) {}
|
||||
}
|
||||
|
||||
main() {}
|
||||
typedef S Reducer<S>(S a, dynamic b);
|
||||
void foo<S>(Reducer<S> v) {}
|
||||
void test() {}
|
|
@ -0,0 +1,11 @@
|
|||
abstract class B {
|
||||
String get f;
|
||||
}
|
||||
|
||||
class A implements B {
|
||||
A(this.f);
|
||||
final f;
|
||||
}
|
||||
|
||||
main() => print(a);
|
||||
var a = new A("foo");
|
|
@ -0,0 +1,22 @@
|
|||
import 'dart:mirrors';
|
||||
|
||||
bool _hasAnnotationInstance(DeclarationMirror declaration, instance) =>
|
||||
declaration.metadata.any((InstanceMirror annotation) {
|
||||
print('annotation: ${annotation.reflectee}');
|
||||
return identical(annotation.reflectee, instance);
|
||||
});
|
||||
bool _hasFailingTestAnnotation(MethodMirror method) {}
|
||||
|
||||
class MyTest {
|
||||
@failingTest
|
||||
void foo() {}
|
||||
}
|
||||
|
||||
class MyTest2 extends Object with MyTest {}
|
||||
|
||||
class _FailingTest {
|
||||
const _FailingTest();
|
||||
}
|
||||
|
||||
const _FailingTest failingTest = const _FailingTest();
|
||||
main() {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'dart:async';
|
||||
|
||||
FutureOr<String> returnsString() async {}
|
||||
main() {}
|
|
@ -0,0 +1,18 @@
|
|||
import 'dart:async';
|
||||
|
||||
Future<List<Object>> f1() async {}
|
||||
Future<Object> f3() async {}
|
||||
Future<X> foo() async {}
|
||||
Future<void> main() async {}
|
||||
List<Object> f2() => [2];
|
||||
|
||||
class X {
|
||||
X(this.x, this.y);
|
||||
final x;
|
||||
final y;
|
||||
toString() => "X($x, $y)";
|
||||
}
|
||||
|
||||
class Y {
|
||||
f(_) {}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
class A {
|
||||
String call(String s) => '$s$s';
|
||||
}
|
||||
|
||||
class B<T> {
|
||||
T call(T t) => t;
|
||||
}
|
||||
|
||||
class C {
|
||||
T call<T>(T t) => t;
|
||||
}
|
||||
|
||||
main() {}
|
||||
test() {}
|
|
@ -0,0 +1,5 @@
|
|||
class A<X> {}
|
||||
|
||||
class B<Z> extends Object with A<Z Function()> {}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,9 @@
|
|||
bar(B b) {}
|
||||
|
||||
class A<X> {
|
||||
foo<Y extends X>() {}
|
||||
}
|
||||
|
||||
class B extends A<dynamic> {}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,12 @@
|
|||
A<num> a = new A<int>();
|
||||
B<num> b = new B<int>();
|
||||
|
||||
class A<T extends num> {
|
||||
void Function<S extends T>(S x) foo() {}
|
||||
}
|
||||
|
||||
class B<T extends num> {
|
||||
void Function(T x) foo() {}
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,36 @@
|
|||
class Callable {
|
||||
call(x) {}
|
||||
}
|
||||
|
||||
class CallableGetter {
|
||||
get call => new Callable();
|
||||
}
|
||||
|
||||
main() {}
|
||||
var callable = new Callable();
|
||||
var callableGetter = new CallableGetter();
|
||||
var closure = (x) => x;
|
||||
var int1 = closure(1);
|
||||
var int2 = closure.call(1);
|
||||
var int3 = closure.call.call(1);
|
||||
var int4 = closure.call.call.call(1);
|
||||
var nothing1 = closure();
|
||||
var nothing10 = callableGetter.call();
|
||||
var nothing11 = callableGetter.call.call();
|
||||
var nothing12 = callableGetter.call.call.call();
|
||||
var nothing2 = closure.call();
|
||||
var nothing3 = closure.call.call();
|
||||
var nothing4 = closure.call.call.call();
|
||||
var nothing5 = callable();
|
||||
var nothing6 = callable.call();
|
||||
var nothing7 = callable.call.call();
|
||||
var nothing8 = callable.call.call.call();
|
||||
var nothing9 = callableGetter();
|
||||
var string1 = callable(1);
|
||||
var string2 = callable.call(1);
|
||||
var string3 = callable.call.call(1);
|
||||
var string4 = callable.call.call.call(1);
|
||||
var string5 = callableGetter(1);
|
||||
var string6 = callableGetter.call(1);
|
||||
var string7 = callableGetter.call.call(1);
|
||||
var string8 = callableGetter.call.call.call(1);
|
|
@ -0,0 +1,9 @@
|
|||
class Fisk {
|
||||
Fisk(int x) {}
|
||||
Fisk.named(int x) {}
|
||||
static void staticMethod(int x) {}
|
||||
void method(int x) {}
|
||||
}
|
||||
|
||||
main() {}
|
||||
test() {}
|
|
@ -0,0 +1 @@
|
|||
main() {}
|
|
@ -0,0 +1 @@
|
|||
main() {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'deferred_lib.dart' deferred as lib;
|
||||
|
||||
main() {}
|
||||
test() {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'deferred_lib.dart' deferred as lib;
|
||||
|
||||
main() {}
|
||||
test(x) {}
|
|
@ -0,0 +1,5 @@
|
|||
import 'deferred_lib.dart' deferred as lib;
|
||||
|
||||
m2() => 1;
|
||||
main() {}
|
||||
test() {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'deferred_lib.dart' deferred as lib;
|
||||
|
||||
main() {}
|
||||
test() async {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'deferred_lib.dart' deferred as lib;
|
||||
|
||||
main() {}
|
||||
test() {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'deferred_lib.dart' deferred as lib;
|
||||
|
||||
main() {}
|
||||
test() {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'deferred_lib.dart' deferred as lib;
|
||||
|
||||
main() {}
|
||||
test(x) {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'deferred_lib.dart' deferred as lib;
|
||||
|
||||
main() {}
|
||||
test() {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'deferred_lib.dart' deferred as lib;
|
||||
|
||||
main() {}
|
||||
test() {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'deferred_lib.dart' deferred as lib;
|
||||
|
||||
main() {}
|
||||
test() {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'deferred_lib.dart' deferred as lib;
|
||||
|
||||
main() {}
|
||||
test() {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'deferred_lib.dart' deferred as lib;
|
||||
|
||||
main() => test();
|
||||
test() {}
|
|
@ -0,0 +1,7 @@
|
|||
class C {
|
||||
C._circular(this.f);
|
||||
var f = new C._circular(null);
|
||||
}
|
||||
|
||||
main() {}
|
||||
var x = new C._circular(null);
|
|
@ -0,0 +1,13 @@
|
|||
class A {
|
||||
A(this.y) : x = 42;
|
||||
final int x;
|
||||
final int y;
|
||||
method() {}
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
B(x) : super(x);
|
||||
method() {}
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,8 @@
|
|||
class Bar {}
|
||||
|
||||
class Foo {
|
||||
var _field = new Bar();
|
||||
}
|
||||
|
||||
main() {}
|
||||
useCallback(callback) {}
|
|
@ -0,0 +1,9 @@
|
|||
A() {}
|
||||
|
||||
class A {
|
||||
const A();
|
||||
}
|
||||
|
||||
class B {}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,43 @@
|
|||
class A {}
|
||||
|
||||
class ARN extends ARQ<A> {}
|
||||
|
||||
class ARO<S> {}
|
||||
|
||||
class ARQ<T> extends Object implements ARO<T> {}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
class C extends B {}
|
||||
|
||||
class D extends C {}
|
||||
|
||||
class G<T extends A> {}
|
||||
|
||||
class GB extends G<B> {}
|
||||
|
||||
class GC extends G<C> {}
|
||||
|
||||
class GD extends G<D> {}
|
||||
|
||||
class GU extends GW {}
|
||||
|
||||
class GV extends GU implements GW {}
|
||||
|
||||
class GW implements Z, GD {}
|
||||
|
||||
class GX implements G<A> {}
|
||||
|
||||
class GY extends X implements GB {}
|
||||
|
||||
class GZ implements Y, GC {}
|
||||
|
||||
class W implements Z {}
|
||||
|
||||
class X implements A {}
|
||||
|
||||
class Y extends X {}
|
||||
|
||||
class Z implements Y {}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,9 @@
|
|||
class A {}
|
||||
|
||||
class B extends A {
|
||||
A operator +(B b) => new C();
|
||||
}
|
||||
|
||||
class C extends A {}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,11 @@
|
|||
class A {
|
||||
A.bad() {}
|
||||
const A() : this.bad();
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
const B() : super.bad();
|
||||
}
|
||||
|
||||
main() {}
|
||||
test() {}
|
|
@ -0,0 +1,40 @@
|
|||
const a0 = 0 ~/ 0;
|
||||
const a1 = 0.0 ~/ 0;
|
||||
const a2 = -0.0 ~/ 0;
|
||||
const a3 = double.nan ~/ 0;
|
||||
const a4 = double.infinity ~/ 0;
|
||||
const a5 = double.negativeInfinity ~/ 0;
|
||||
const b0 = 0 ~/ 0.0;
|
||||
const b1 = 0.0 ~/ 0.0;
|
||||
const b2 = -0.0 ~/ 0.0;
|
||||
const b3 = double.nan ~/ 0.0;
|
||||
const b4 = double.infinity ~/ 0.0;
|
||||
const b5 = double.negativeInfinity ~/ 0.0;
|
||||
const c0 = 0 ~/ -0.0;
|
||||
const c1 = 0.0 ~/ -0.0;
|
||||
const c2 = -0.0 ~/ -0.0;
|
||||
const c3 = double.nan ~/ -0.0;
|
||||
const c4 = double.infinity ~/ -0.0;
|
||||
const c5 = double.negativeInfinity ~/ -0.0;
|
||||
const d0 = 0 ~/ double.nan;
|
||||
const d1 = 0.0 ~/ double.nan;
|
||||
const d2 = -0.0 ~/ double.nan;
|
||||
const d3 = double.nan ~/ double.nan;
|
||||
const d4 = double.infinity ~/ double.nan;
|
||||
const d5 = double.negativeInfinity ~/ double.nan;
|
||||
const e0 = 0 ~/ double.infinity;
|
||||
const e1 = 0.0 ~/ double.infinity;
|
||||
const e2 = -0.0 ~/ double.infinity;
|
||||
const e3 = double.nan ~/ double.infinity;
|
||||
const e4 = double.infinity ~/ double.infinity;
|
||||
const e5 = double.negativeInfinity ~/ double.infinity;
|
||||
const f0 = 0 ~/ double.negativeInfinity;
|
||||
const f1 = 0.0 ~/ double.negativeInfinity;
|
||||
const f2 = -0.0 ~/ double.negativeInfinity;
|
||||
const f3 = double.nan ~/ double.negativeInfinity;
|
||||
const f4 = double.infinity ~/ double.negativeInfinity;
|
||||
const f5 = double.negativeInfinity ~/ double.negativeInfinity;
|
||||
main() {}
|
||||
void expect(expected, actual) {}
|
||||
void test(num a, num b, num Function() f) {}
|
||||
void throws(num Function() f) {}
|
|
@ -0,0 +1,14 @@
|
|||
class A<T> {
|
||||
A(this.x);
|
||||
_Y<T> x;
|
||||
}
|
||||
|
||||
class B<T> extends A<T> {
|
||||
B() : super(const _Y());
|
||||
}
|
||||
|
||||
class _Y<T> {
|
||||
const _Y();
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,8 @@
|
|||
class A {
|
||||
A() : this();
|
||||
A.bar() : this.foo();
|
||||
A.baz() : this.foo();
|
||||
A.foo() : this.bar();
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,17 @@
|
|||
class A {
|
||||
A();
|
||||
}
|
||||
|
||||
class B {
|
||||
B(int x, double y, String s);
|
||||
}
|
||||
|
||||
class C<T> {
|
||||
C();
|
||||
}
|
||||
|
||||
class D<T, S> {
|
||||
D(T x, S y);
|
||||
}
|
||||
|
||||
void main() {}
|
|
@ -0,0 +1,6 @@
|
|||
import "continue_inference_after_error_lib.dart" as lib;
|
||||
|
||||
class C {}
|
||||
|
||||
main() {}
|
||||
test() {}
|
|
@ -0,0 +1,2 @@
|
|||
main() {}
|
||||
oracle() => true;
|
|
@ -0,0 +1,21 @@
|
|||
class A {}
|
||||
|
||||
class B extends A {
|
||||
int get foo => 42;
|
||||
}
|
||||
|
||||
main() {}
|
||||
oracle<T>([T t]) => true;
|
||||
testForElement(
|
||||
dynamic dynVar,
|
||||
List<int> listInt,
|
||||
List<double> listDouble,
|
||||
int index,
|
||||
Map<String, int> mapStringInt,
|
||||
Map<String, double> mapStringDouble) {}
|
||||
testForElementErrors(Map<int, int> map, List<int> list) async {}
|
||||
testForElementErrorsNotAsync(Stream<int> stream) {}
|
||||
testIfElement(dynamic dynVar, List<int> listInt, List<double> listDouble,
|
||||
Map<String, int> mapToInt, Map<String, double> mapToDouble) {}
|
||||
testIfElementErrors(Map<int, int> map) {}
|
||||
testPromotion(A a) {}
|
|
@ -0,0 +1,16 @@
|
|||
class A {
|
||||
bool operator ==(covariant A other) => true;
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
bool operator ==(other) => true;
|
||||
}
|
||||
|
||||
class C<T> {
|
||||
bool operator ==(covariant C<T> other) => true;
|
||||
}
|
||||
|
||||
class D extends C<int> {}
|
||||
|
||||
main() {}
|
||||
test(A a, B b, C c_dynamic, C<int> c_int, C<String> c_string, D d) {}
|
|
@ -0,0 +1,13 @@
|
|||
class Foo<T> {
|
||||
Callback<T> mutableCallbackField;
|
||||
Foo(this.finalField, this.callbackField);
|
||||
T mutableField;
|
||||
final Callback<T> callbackField;
|
||||
final T finalField;
|
||||
set setter(T x) {}
|
||||
void method(T x) {}
|
||||
void withCallback(Callback<T> callback) {}
|
||||
}
|
||||
|
||||
main() {}
|
||||
typedef void Callback<T>(T x);
|
|
@ -0,0 +1,17 @@
|
|||
class A {
|
||||
void foo(covariant num x) {}
|
||||
}
|
||||
|
||||
class B {
|
||||
void foo(num x) {}
|
||||
}
|
||||
|
||||
class C {
|
||||
void foo(num x) {}
|
||||
}
|
||||
|
||||
class D extends A with B implements C {
|
||||
void foo(int x) {}
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,9 @@
|
|||
class A implements C {}
|
||||
|
||||
class B extends A {}
|
||||
|
||||
class C extends B implements D {}
|
||||
|
||||
class D {}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,2 @@
|
|||
main() {}
|
||||
topLevel([a = 42]) => a;
|
|
@ -0,0 +1,4 @@
|
|||
import 'deferred_lib.dart' deferred as d;
|
||||
|
||||
bad(d.C x) {}
|
||||
main() {}
|
|
@ -0,0 +1,2 @@
|
|||
main() {}
|
||||
method<T>(T a, T b) {}
|
|
@ -0,0 +1,13 @@
|
|||
import 'duplicated_bad_prefix_lib1.dart' as dupe;
|
||||
import 'duplicated_bad_prefix_lib2.dart' as dupe;
|
||||
|
||||
class C {
|
||||
Dupe.a b;
|
||||
dupe.C d;
|
||||
}
|
||||
|
||||
class Dupe {}
|
||||
|
||||
class Dupe {}
|
||||
|
||||
main() {}
|
|
@ -27,5 +27,7 @@ class Sub extends C {
|
|||
class C {
|
||||
C._();
|
||||
}
|
||||
enum Enum { Enum, a, a, b, } enum Enum { a, b, c, } enum AnotherEnum { a, b, c, _name, index, toString, values, }
|
||||
enum Enum { Enum, a, a, b, }
|
||||
enum Enum { a, b, c, }
|
||||
enum AnotherEnum { a, b, c, _name, index, toString, values, }
|
||||
useAnotherEnum() { }
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
class A {
|
||||
A(this.a);
|
||||
int a;
|
||||
int a;
|
||||
}
|
||||
|
||||
void main() {}
|
|
@ -0,0 +1,8 @@
|
|||
library test;
|
||||
|
||||
class C {
|
||||
static m({int a: 0}) {}
|
||||
}
|
||||
|
||||
main() {}
|
||||
void test() {}
|
|
@ -0,0 +1,5 @@
|
|||
import 'dart:core' show int;
|
||||
|
||||
dynamic testDynamic() => 0;
|
||||
main() {}
|
||||
void testVoid() {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'error_location_01_lib1.dart';
|
||||
import 'error_location_01_lib2.dart';
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,5 @@
|
|||
import 'error_location_02_lib1.dart';
|
||||
import 'error_location_02_lib2.dart';
|
||||
import 'error_location_02_lib3.dart';
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,5 @@
|
|||
import 'error_location_03_lib1.dart';
|
||||
import 'error_location_03_lib2.dart';
|
||||
import 'error_location_03_lib3.dart';
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,4 @@
|
|||
import 'error_location_04_lib1.dart';
|
||||
import 'error_location_04_lib2.dart';
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,3 @@
|
|||
library error_location_05;
|
||||
|
||||
part 'error_location_05_lib1.dart';
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue