Files
sdk/pkg/kernel/testcases/input/micro.dart
T
Asger Feldthaus 4b860db14b [kernel] Reorganize baseline testing.
A single suite of test files is now shared among these configurations,
each with their own expected outputs:
- spec mode
- strong mode
- spec mode w/ type propagation

Although some tests are going to focus on a specific configuration,
for now it seems easier to maintain a single set of tests.

No additional tests have been added in this CL, but the intention
is to start adding more tests.

The baseline tests no longer contain any checked-in dill files.

To simplify dependencies, these tests do not rely on a patched SDK,
which means the async transformer cannot currently be tested with
this framework.

BUG=
R=kmillikin@google.com

Review URL: https://chromereviews.googleplex.com/507347013 .
2016-09-21 12:23:11 +02:00

76 lines
1.2 KiB
Dart

staticMethod() {
return "sdfg";
}
class Foo {
instanceMethod() {
return 123;
}
}
external bool externalStatic();
abstract class ExternalValue {}
abstract class Bar {
ExternalValue externalInstanceMethod();
}
external Bar createBar();
class Box {
var field;
}
stringArgument(x) {
}
intArgument(x) {
}
class FinalBox {
final finalField;
FinalBox(this.finalField);
}
class SubFinalBox extends FinalBox {
SubFinalBox(value) : super(value);
}
class DynamicReceiver1 {
dynamicallyCalled(x) {}
}
class DynamicReceiver2 {
dynamicallyCalled(x) {}
}
void makeDynamicCall(receiver) {
receiver.dynamicallyCalled("sdfg");
}
main() {
var x = staticMethod();
var y = new Foo().instanceMethod();
var z = externalStatic();
var w = createBar().externalInstanceMethod();
stringArgument("sdfg");
intArgument(42);
var box = new Box();
box.field = "sdfg";
var a = box.field;
var finalBox = new FinalBox("dfg");
var b = finalBox.finalField;
var subBox = new SubFinalBox("dfg");
var c = subBox.finalField;
makeDynamicCall(new DynamicReceiver1());
makeDynamicCall(new DynamicReceiver2());
var list = ["string"];
var d = list[0];
}