blob: c122e52220914ecac0f39a8d9e28b87c25f070c4 [file] [log] [blame]
library;
import self as self;
import "dart:core" as core;
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/expressions.dart:74:16: Error: Method not found: 'int.toString'.
print(int?.toString());
^^^^^^^^"]/* from null */;
static method foo({dynamic fisk = null}) → dynamic {
core::print(fisk);
}
static method caller(dynamic f) → dynamic {
f.call();
}
static method main() → dynamic {
core::int i = 0;
core::print(i.{core::num::==}(1) ?{core::String} "bad" : "good");
core::print("${i}");
core::print("'${i}'");
core::print(" '${i}' ");
core::print(" '${i}' '${i}'");
core::print(" '${i}' '${i}'");
core::print("foobar");
core::print(" '${i}' '${i}' '${i}' '${i}'");
try {
throw "fisk";
}
on core::String catch(final core::String e, final core::StackTrace s) {
core::print(e);
if(!s.{core::Object::==}(null))
core::print(s);
}
for (; false; ) {
}
core::List<core::String> list = <core::String>["Hello, World!"];
core::print(list.{core::List::[]}(i));
list.{core::List::[]=}(i, "Hello, Brave New World!");
core::print(list.{core::List::[]}(i));
i = 87;
core::print(i.{core::int::unary-}());
core::print(i.{core::int::~}());
core::print(!i.{core::num::==}(42));
core::print(i = i.{core::num::-}(1));
core::print(i = i.{core::num::+}(1));
core::print(let final core::int #t1 = i in let final core::int #t2 = i = #t1.{core::num::-}(1) in #t1);
core::print(let final core::int #t3 = i in let final core::int #t4 = i = #t3.{core::num::+}(1) in #t3);
core::print(new core::Object::•());
core::print(const core::Object::•());
core::print(core::List::•<core::String>(2).{core::Object::runtimeType});
self::foo(fisk: "Blorp gulp");
function f() → core::Null {
core::print("f was called");
}
self::caller(f);
self::caller(() → core::Null {
core::print("<anon> was called");
});
function g([dynamic message = null]) → core::Null {
core::print(message);
}
g.call("Hello, World");
self::caller(([dynamic x = null]) → core::Null {
core::print("<anon> was called with ${x}");
});
function h({dynamic message = null}) → core::Null {
core::print(message);
}
h.call(message: "Hello, World");
self::caller(({dynamic x = null}) → core::Null {
core::print("<anon> was called with ${x}");
});
core::print(core::int.{core::Object::toString}());
core::print(core::int);
core::print(let final core::Type #t5 = core::int in let final core::String #t6 = #t5.{core::Object::toString}() in #t5);
try {
core::print(throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#int.toString, 32, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}))));
throw "Shouldn't work";
}
on core::NoSuchMethodError catch(final core::NoSuchMethodError e) {
core::print("As expected: ${e}");
}
core::print(core::int::parse("42"));
}