diff --git a/tests/language_2/language_2.status b/tests/language_2/language_2.status index b55da224c84..1366be977f5 100644 --- a/tests/language_2/language_2.status +++ b/tests/language_2/language_2.status @@ -58,6 +58,8 @@ issue_22780_test/01: Pass, Crash # Issue 29094 issue_1751477_test: Crash # Requires deferred libraries vm/regress_27201_test: Pass, Crash # Requires deferred libraries vm/optimized_stacktrace_test: Pass, Slow +regress_23408_test: Crash # Requires deferred libraries +regress_22443_test: Crash # Requires deferred libraries [ $checked && ! $strong ] type_parameter_test/05: Pass diff --git a/tests/language_2/language_2_analyzer.status b/tests/language_2/language_2_analyzer.status index 49355080152..f429f893f0b 100644 --- a/tests/language_2/language_2_analyzer.status +++ b/tests/language_2/language_2_analyzer.status @@ -803,6 +803,8 @@ private_member1_negative_test: fail # Issue 14021 private_member2_negative_test: fail # Issue 14021 private_member3_negative_test: fail # Issue 14021 prefix7_negative_test: CompileTimeError +regress_27617_test/1: MissingCompileTimeError +regress_23408_test: Skip # don't care about the static warning. [ $strong && $compiler == dart2analyzer ] accessor_conflict_export2_test: CompileTimeError # Issue 25626 @@ -1089,6 +1091,10 @@ prefix16_test/01: MissingCompileTimeError prefix18_negative_test: CompileTimeError, OK prefix22_test/00: MissingCompileTimeError prefix23_test/00: MissingCompileTimeError +regress_22936_test: MissingCompileTimeError +regress_23089_test: MissingCompileTimeError +regress_26133_test: MissingCompileTimeError +regress_27572_test: MissingCompileTimeError string_interpolation_test/01: MissingCompileTimeError string_no_operator_test/01: MissingCompileTimeError string_no_operator_test/02: MissingCompileTimeError diff --git a/tests/language_2/language_2_dart2js.status b/tests/language_2/language_2_dart2js.status index 4c1c93576b7..91855648471 100644 --- a/tests/language_2/language_2_dart2js.status +++ b/tests/language_2/language_2_dart2js.status @@ -447,6 +447,11 @@ override_inheritance_no_such_method_test/12: MissingCompileTimeError override_inheritance_no_such_method_test/13: MissingCompileTimeError override_method_with_field_test/02: MissingCompileTimeError part2_test/01: MissingCompileTimeError +regress_26133_test: MissingCompileTimeError +regress_22936_test: MissingCompileTimeError +regress_23089_test: MissingCompileTimeError +regress_23408_test: RuntimeError +regress_27572_test: MissingCompileTimeError static_field3_test/01: MissingCompileTimeError static_field3_test/02: MissingCompileTimeError static_field3_test/03: MissingCompileTimeError @@ -714,6 +719,8 @@ list_literal4_test/05: MissingCompileTimeError list_literal_syntax_test/01: MissingCompileTimeError list_literal_syntax_test/02: MissingCompileTimeError list_literal_syntax_test/03: MissingCompileTimeError +regress_22976_test: CompileTimeError # Issue 23132 +regress_24283_test: RuntimeError # Issue 1533 external_test/10: CompileTimeError # Issue 12887 external_test/13: CompileTimeError # Issue 12887 external_test/20: CompileTimeError # Issue 12887 @@ -1189,6 +1196,18 @@ external_test/10: MissingRuntimeError external_test/13: MissingRuntimeError external_test/20: MissingRuntimeError factory_redirection_test/07: MissingCompileTimeError +regress_22443_test: CompileTimeError +regress_22976_test/01: CompileTimeError +regress_22976_test/02: CompileTimeError +regress_22976_test/none: CompileTimeError +regress_23408_test: CompileTimeError +regress_23996_test: RuntimeError +regress_24283_test: RuntimeError +regress_27572_test: RuntimeError +regress_27617_test/1: Crash # Assertion failure: Unexpected constructor j:constructor(Foo._) in ConstructorDataImpl._getConstructorConstant +regress_28217_test/01: MissingCompileTimeError +regress_28217_test/none: MissingCompileTimeError +regress_28255_test: RuntimeError [ $compiler == dart2js && $dart2js_with_kernel && $minified ] assertion_initializer_const_error2_test/none: CompileTimeError @@ -1493,6 +1512,16 @@ external_test/20: MissingRuntimeError f_bounded_quantification4_test: RuntimeError f_bounded_quantification5_test: RuntimeError factory_redirection_test/07: MissingCompileTimeError +regress_22443_test: CompileTimeError +regress_22976_test: CompileTimeError +regress_23408_test: CompileTimeError +regress_23996_test: RuntimeError +regress_24283_test: RuntimeError, OK # Requires 64 bit numbers. +regress_27572_test: RuntimeError +regress_27617_test/1: Crash # Assertion failure: Unexpected constructor j:constructor(Foo._) in ConstructorDataImpl._getConstructorConstant +regress_28217_test/01: MissingCompileTimeError +regress_28217_test/none: MissingCompileTimeError +regress_28255_test: RuntimeError [ $compiler == dart2js && $dart2js_with_kernel && $minified && $checked ] inline_super_field_test: Crash @@ -1509,6 +1538,7 @@ async_star_await_pauses_test: RuntimeError # Need triage async_star_no_cancel2_test: RuntimeError # Need triage async_star_no_cancel_test: RuntimeError # Need triage await_for_test: Skip # Jsshell does not provide periodic timers, Issue 7728 +regress_23996_test: RuntimeError # Jsshell does not provide non-zero timers, Issue 7728 [ $compiler == dart2js && $runtime == jsshell ] async_star_test/01: RuntimeError @@ -1523,6 +1553,7 @@ async_return_types_test/nestedFuture: Fail # Issue 26429 async_return_types_test/wrongTypeParameter: Fail # Issue 26429 covariant_subtyping_test: CompileTimeError default_factory2_test/01: Fail # Issue 14121 +regress_26133_test: RuntimeError # Issue 26429 [ $compiler == dart2js && !$checked && !$dart2js_with_kernel ] bool_check_test: RuntimeError # Issue 29647 @@ -1555,6 +1586,7 @@ null_test/0*: Pass # mirrors not supported, fails for the wrong reason null_test/none: Fail # mirrors not supported overridden_no_such_method_test: Fail # mirrors not supported vm/reflect_core_vm_test: Fail # mirrors not supported +regress_28255_test: Fail # mirrors not supported [ $compiler == dart2js && $runtime == chrome && $system == macos && !$dart2js_with_kernel ] await_future_test: Pass, Timeout # Issue 26735 @@ -1592,3 +1624,9 @@ round_test: Pass, Fail, OK # Fixed in ff 35. Common JavaScript engine Math.round [ $compiler == dart2js && $minified && ! $dart2js_with_kernel ] f_bounded_quantification4_test: Fail, Pass # Issue 12605 symbol_conflict_test: RuntimeError # Issue 23857 + +[ $compiler == dart2js && $host_checked && !$dart2js_with_kernel ] +regress_26855_test/1: Crash # Issue 26867 +regress_26855_test/2: Crash # Issue 26867 +regress_26855_test/3: Crash # Issue 26867 +regress_26855_test/4: Crash # Issue 26867 diff --git a/tests/language_2/language_2_dartdevc.status b/tests/language_2/language_2_dartdevc.status index 4d53144c8d7..555c16650be 100644 --- a/tests/language_2/language_2_dartdevc.status +++ b/tests/language_2/language_2_dartdevc.status @@ -102,6 +102,11 @@ parameter_initializer_test: CompileTimeError parser_quirks_test: CompileTimeError part_refers_to_core_library_test/01: Crash export_private_test/01: MissingCompileTimeError # Issue 29920 +regress_22443_test: RuntimeError +regress_24283_test: RuntimeError, OK # Requires 64 bit numbers. +regress_23408_test: CompileTimeError +regress_25568_test: RuntimeError +regress_27617_test/1: MissingCompileTimeError [ $strong && $compiler == dartdevc ] accessor_conflict_export2_test: CompileTimeError # Issue 25626 diff --git a/tests/language_2/language_2_flutter.status b/tests/language_2/language_2_flutter.status index 703e6d6257d..47c2689e450 100644 --- a/tests/language_2/language_2_flutter.status +++ b/tests/language_2/language_2_flutter.status @@ -274,6 +274,8 @@ wrong_number_type_arguments_test/01: CompileTimeError wrong_number_type_arguments_test/02: CompileTimeError new_expression_type_args_test/02: CompileTimeError no_such_method_test: CompileTimeError +regress_28255_test: CompileTimeError +regress_23408_test: CompileTimeError private_access_test/03: CompileTimeError private_access_test/04: CompileTimeError list_literal_syntax_test/03: CompileTimeError diff --git a/tests/language_2/language_2_kernel.status b/tests/language_2/language_2_kernel.status index f2bcb05ddb7..f5b3badc93d 100644 --- a/tests/language_2/language_2_kernel.status +++ b/tests/language_2/language_2_kernel.status @@ -250,6 +250,8 @@ map_literal1_test/01: MissingCompileTimeError type_parameter_test/05: MissingCompileTimeError type_parameter_test/none: RuntimeError type_variable_bounds4_test/01: RuntimeError +regress_22728_test: RuntimeError +regress_26133_test: RuntimeError factory_redirection_test/08: Fail factory_redirection_test/09: Fail factory_redirection_test/10: Fail @@ -426,6 +428,11 @@ external_test/10: MissingRuntimeError # KernelVM bug: Unbound external. external_test/13: MissingRuntimeError # KernelVM bug: Unbound external. external_test/20: MissingRuntimeError # KernelVM bug: Unbound external. factory_redirection_test/07: MissingCompileTimeError # Fasta bug: Bad constructor redirection. +regress_22443_test: CompileTimeError # Fasta/KernelVM bug: Deferred loading kernel issue 28335. +regress_23408_test: CompileTimeError # Fasta/KernelVM bug: Deferred loading kernel issue 28335. +regress_27617_test/1: MissingCompileTimeError # Fasta bug: Bad constructor redirection. +regress_28217_test/01: MissingCompileTimeError # Fasta bug: Bad constructor redirection. +regress_28217_test/none: MissingCompileTimeError # Fasta bug: Bad constructor redirection. [ $checked && ($compiler == dartk || $compiler == dartkp) ] assign_static_type_test/02: MissingCompileTimeError @@ -504,5 +511,8 @@ deopt_inlined_function_lazy_test: Skip [ $compiler == dartkp || $compiler == dartk ] async_star_test/01: Pass +[ ($compiler == dartk || $compiler == dartkp) && $checked ] +regress_22728_test: Fail # Dartk Issue 28498 + [ $compiler == dartkp && $mode == debug ] external_test/13: Crash diff --git a/tests/language_2/language_2_precompiled.status b/tests/language_2/language_2_precompiled.status index 944b7ef5d80..2c8ef145d15 100644 --- a/tests/language_2/language_2_precompiled.status +++ b/tests/language_2/language_2_precompiled.status @@ -429,6 +429,10 @@ prefix16_test/00: MissingCompileTimeError prefix16_test/01: MissingCompileTimeError prefix22_test/00: MissingCompileTimeError prefix23_test/00: MissingCompileTimeError +regress_22936_test: MissingCompileTimeError +regress_23089_test: MissingCompileTimeError +regress_27572_test: MissingCompileTimeError +regress_26133_test: MissingCompileTimeError static_field3_test/01: MissingCompileTimeError static_field3_test/02: MissingCompileTimeError static_field3_test/03: MissingCompileTimeError @@ -574,6 +578,7 @@ void_block_return_test/00: MissingCompileTimeError void_block_return_test/00: MissingCompileTimeError wrong_number_type_arguments_test/*: MissingCompileTimeError library_env_test/has_mirror_support: RuntimeError, OK +regress_28255_test: SkipByDesign export_ambiguous_main_test: Crash f_bounded_quantification_test/01: MissingCompileTimeError f_bounded_quantification_test/02: MissingCompileTimeError @@ -744,6 +749,7 @@ deferred_global_test: Fail deopt_inlined_function_lazy_test: Skip # Incompatible flag: --deoptimize-alot implicit_closure_test: Skip # Incompatible flag: --use_slow_path vm/regress_27201_test: Fail +regress_23408_test: RuntimeError [ $mode == product || $compiler == app_jit || $compiler == precompiler ] deferred_load_constants_test/02: Fail diff --git a/tests/language_2/language_2_vm.status b/tests/language_2/language_2_vm.status index aeb1a25a253..38d630e9a6f 100644 --- a/tests/language_2/language_2_vm.status +++ b/tests/language_2/language_2_vm.status @@ -415,6 +415,11 @@ prefix16_test/00: MissingCompileTimeError prefix16_test/01: MissingCompileTimeError prefix22_test/00: MissingCompileTimeError prefix23_test/00: MissingCompileTimeError +regress_22936_test: MissingCompileTimeError +regress_23089_test: MissingCompileTimeError +regress_23408_test: RuntimeError +regress_27572_test: MissingCompileTimeError +regress_26133_test: MissingCompileTimeError static_field3_test/01: MissingCompileTimeError static_field3_test/02: MissingCompileTimeError static_field3_test/03: MissingCompileTimeError @@ -814,6 +819,7 @@ type_parameter_test/05: MissingCompileTimeError [ $compiler == app_jit && $runtime == vm ] generic_methods_reuse_type_variables_test: RuntimeError type_parameter_test/05: MissingCompileTimeError +regress_23408_test: Crash [ $compiler == app_jit && $runtime == vm && !$checked ] assertion_initializer_const_error2_test/cc02: MissingCompileTimeError diff --git a/tests/language_strong/regress_22443_lib.dart b/tests/language_2/regress_22443_lib.dart similarity index 100% rename from tests/language_strong/regress_22443_lib.dart rename to tests/language_2/regress_22443_lib.dart diff --git a/tests/language_strong/regress_22443_test.dart b/tests/language_2/regress_22443_test.dart similarity index 99% rename from tests/language_strong/regress_22443_test.dart rename to tests/language_2/regress_22443_test.dart index bb4abd25f5e..d3fbe9ca638 100644 --- a/tests/language_strong/regress_22443_test.dart +++ b/tests/language_2/regress_22443_test.dart @@ -19,7 +19,6 @@ main() { } catch (e) { caughtIt = true; } - ; D.loadLibrary().then((_) { foo(); Expect.isTrue(caughtIt); diff --git a/tests/language_strong/regress_22445_test.dart b/tests/language_2/regress_22445_test.dart similarity index 100% rename from tests/language_strong/regress_22445_test.dart rename to tests/language_2/regress_22445_test.dart diff --git a/tests/language_strong/regress_22579_test.dart b/tests/language_2/regress_22579_test.dart similarity index 100% rename from tests/language_strong/regress_22579_test.dart rename to tests/language_2/regress_22579_test.dart diff --git a/tests/language_strong/regress_22666_test.dart b/tests/language_2/regress_22666_test.dart similarity index 100% rename from tests/language_strong/regress_22666_test.dart rename to tests/language_2/regress_22666_test.dart diff --git a/tests/language_strong/regress_22700_test.dart b/tests/language_2/regress_22700_test.dart similarity index 100% rename from tests/language_strong/regress_22700_test.dart rename to tests/language_2/regress_22700_test.dart diff --git a/tests/language_strong/regress_22719_test.dart b/tests/language_2/regress_22719_test.dart similarity index 100% rename from tests/language_strong/regress_22719_test.dart rename to tests/language_2/regress_22719_test.dart diff --git a/tests/language_strong/regress_22728_test.dart b/tests/language_2/regress_22728_test.dart similarity index 100% rename from tests/language_strong/regress_22728_test.dart rename to tests/language_2/regress_22728_test.dart diff --git a/tests/language_strong/regress_22777_test.dart b/tests/language_2/regress_22777_test.dart similarity index 100% rename from tests/language_strong/regress_22777_test.dart rename to tests/language_2/regress_22777_test.dart diff --git a/tests/language_strong/regress_22822_test.dart b/tests/language_2/regress_22822_test.dart similarity index 100% rename from tests/language_strong/regress_22822_test.dart rename to tests/language_2/regress_22822_test.dart diff --git a/tests/language_strong/regress_22858_test.dart b/tests/language_2/regress_22858_test.dart similarity index 100% rename from tests/language_strong/regress_22858_test.dart rename to tests/language_2/regress_22858_test.dart diff --git a/tests/language_strong/regress_22936_test.dart b/tests/language_2/regress_22936_test.dart similarity index 89% rename from tests/language_strong/regress_22936_test.dart rename to tests/language_2/regress_22936_test.dart index 700e1333b1a..878e7c41913 100644 --- a/tests/language_strong/regress_22936_test.dart +++ b/tests/language_2/regress_22936_test.dart @@ -16,8 +16,7 @@ foo() { main() { final x = null; try { - x = // //# 01: static type warning - foo(); + x = /*@compile-error=unspecified*/ foo(); } on NoSuchMethodError {} Expect.isTrue(fooCalled); } diff --git a/tests/language_strong/regress_22976_test.dart b/tests/language_2/regress_22976_test.dart similarity index 70% rename from tests/language_strong/regress_22976_test.dart rename to tests/language_2/regress_22976_test.dart index 14d2d3a1495..d64ef30000c 100644 --- a/tests/language_strong/regress_22976_test.dart +++ b/tests/language_2/regress_22976_test.dart @@ -11,6 +11,8 @@ class B implements A {} class C implements B, A {} main() { - A a0 = new C(); //# 01: ok - A a1 = new C(); //# 02: ok + C c1 = new C(); + C c2 = new C(); + A a0 = c1; //# 01: ok + A a1 = c2; //# 02: ok } diff --git a/tests/language_strong/regress_23038_test.dart b/tests/language_2/regress_23038_test.dart similarity index 100% rename from tests/language_strong/regress_23038_test.dart rename to tests/language_2/regress_23038_test.dart diff --git a/tests/language_strong/regress_23046_test.dart b/tests/language_2/regress_23046_test.dart similarity index 100% rename from tests/language_strong/regress_23046_test.dart rename to tests/language_2/regress_23046_test.dart diff --git a/tests/language_strong/regress_23051_test.dart b/tests/language_2/regress_23051_test.dart similarity index 80% rename from tests/language_strong/regress_23051_test.dart rename to tests/language_2/regress_23051_test.dart index 2c340081b4c..58ac140f6a3 100644 --- a/tests/language_strong/regress_23051_test.dart +++ b/tests/language_2/regress_23051_test.dart @@ -9,7 +9,7 @@ main() { } class A { // //# 01: continued - // Note the trailing ' in the next line. //# 01: continued + // Note the trailing ' in the next line. //# 01: continued get foo => bar();' // //# 01: continued -/// 01: continued + // //# 01: continued String bar( // //# 01: continued diff --git a/tests/language_strong/regress_23089_test.dart b/tests/language_2/regress_23089_test.dart similarity index 71% rename from tests/language_strong/regress_23089_test.dart rename to tests/language_2/regress_23089_test.dart index 4ee11bcec2e..2718475177d 100644 --- a/tests/language_strong/regress_23089_test.dart +++ b/tests/language_2/regress_23089_test.dart @@ -2,7 +2,11 @@ // 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. -abstract class IPeer {} +// Test doesn't cover http://dartbug.com/23089 anymore. +// Generic bounds now must be fully instantiated. This means that the +// cycle is not possible anymore. + +abstract class IPeer {} abstract class IPeerRoom

{} diff --git a/tests/language_strong/regress_23408_lib.dart b/tests/language_2/regress_23408_lib.dart similarity index 100% rename from tests/language_strong/regress_23408_lib.dart rename to tests/language_2/regress_23408_lib.dart diff --git a/tests/language_strong/regress_23408_test.dart b/tests/language_2/regress_23408_test.dart similarity index 72% rename from tests/language_strong/regress_23408_test.dart rename to tests/language_2/regress_23408_test.dart index f47f1cb9503..4372b543453 100644 --- a/tests/language_strong/regress_23408_test.dart +++ b/tests/language_2/regress_23408_test.dart @@ -2,6 +2,9 @@ // 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. +// This test has been modified: it is now ok to use deferred types as long as +// they aren't instantiated. + library regress_23408_test; import 'package:expect/expect.dart'; @@ -9,7 +12,7 @@ import 'package:expect/expect.dart'; import 'regress_23408_lib.dart' deferred as lib; class A extends C { - get t => "$T"; + get t => T; } class C { @@ -20,12 +23,12 @@ class C { } void main() { - var a = new C.l(); // Redirects to A - Expect.equals("dynamic", a.t); + var a = new C.l(); + Expect.equals(lib.K, a.t); Expect.throws(() => new C.c()); lib.loadLibrary().then((_) { - var b = new C.l(); // Still redirects to A - Expect.equals("dynamic", b.t); + var b = new C.l(); + Expect.equals(lib.K, b.t); var z = new C.c(); Expect.equals(55, z.v); }); diff --git a/tests/language_strong/regress_23498_test.dart b/tests/language_2/regress_23498_test.dart similarity index 100% rename from tests/language_strong/regress_23498_test.dart rename to tests/language_2/regress_23498_test.dart diff --git a/tests/language_strong/regress_23500_test.dart b/tests/language_2/regress_23500_test.dart similarity index 100% rename from tests/language_strong/regress_23500_test.dart rename to tests/language_2/regress_23500_test.dart diff --git a/tests/language_strong/regress_23537_test.dart b/tests/language_2/regress_23537_test.dart similarity index 100% rename from tests/language_strong/regress_23537_test.dart rename to tests/language_2/regress_23537_test.dart diff --git a/tests/language_strong/regress_23650_test.dart b/tests/language_2/regress_23650_test.dart similarity index 100% rename from tests/language_strong/regress_23650_test.dart rename to tests/language_2/regress_23650_test.dart diff --git a/tests/language_2/regress_23996_test.dart b/tests/language_2/regress_23996_test.dart new file mode 100644 index 00000000000..4401a468d4e --- /dev/null +++ b/tests/language_2/regress_23996_test.dart @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 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. + +import "dart:async"; +import "package:async_helper/async_helper.dart"; + +/// This test verifies that an await for loop sends the correct +/// signals to the stream it iterates over: +/// 1) A listen event. +/// 2) A pause event when the loop body is awaiting something, +/// and more elements arrive on the stream. See issue +/// https://github.com/dart-lang/sdk/issues/23996 . +/// 3) A resume event, when the loop is again ready to iterate. +main() { + Completer listenEventReceived = new Completer(); + Completer pauseEventReceived = new Completer(); + Completer resumeEventReceived = new Completer(); + StreamController controller = new StreamController( + onListen: () => listenEventReceived.complete(), + onPause: () => pauseEventReceived.complete(), + onResume: () => resumeEventReceived.complete()); + + Completer forLoopEntered = new Completer(); + + /// The send function puts items on the stream. It waits for a + /// listener, puts "first" on the stream, waits for the for loop + /// to start (and eventually block), puts "second" on the stream + /// multiple times, letting the event loop run, until the for loop + /// pauses the stream because it it blocked. + /// The for loop unblocks after the pause message is received, and + /// reads the stream items, sending a stream resume message when it + /// is ready for more. + /// Then the send function puts a final "third" on the stream, and + /// closes the stream. + send() async { + await listenEventReceived.future; + controller.add('first'); + await forLoopEntered.future; + var timer = new Timer.periodic(new Duration(milliseconds: 10), (timer) { + controller.add('second'); + }); + await pauseEventReceived.future; + // pauseEventReceived.future completes when controller.stream is + // paused by the await-for loop below. What's specified is that + // await-for must pause immediately on an "await", but instead + // the implementations agree on not pausing until receiving the + // next event. For this reason, [timer] will call its callback at + // least once before we cancel it again. + timer.cancel(); + await resumeEventReceived.future; + controller.add('third'); + controller.close(); + } + + receive() async { + bool thirdReceived = false; + await for (var entry in controller.stream) { + if (entry == 'first') { + forLoopEntered.complete(); + await pauseEventReceived.future; + } else if (entry == 'third') { + thirdReceived = true; + } + } + if (!thirdReceived) { + throw "Error in await-for loop: 'third' not received"; + } + } + + asyncTest(() async { + // We need to start both functions in parallel, and wait on them both. + var f = send(); + await receive(); + await f; + }); +} diff --git a/tests/language_2/regress_24283_test.dart b/tests/language_2/regress_24283_test.dart new file mode 100644 index 00000000000..056bfd8a41d --- /dev/null +++ b/tests/language_2/regress_24283_test.dart @@ -0,0 +1,18 @@ +// Copyright (c) 2015, 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. + +import "package:expect/expect.dart"; + +main() { + // Smi + var i = 1 << 30; + var j = -i; + Expect.equals(0, i >> 37); + Expect.equals(-1, j >> 37); + // Mint + i = 1 << 50; + j = -i; + Expect.equals(0, i >> 67); + Expect.equals(-1, j >> 67); +} diff --git a/tests/language_2/regress_24567_test.dart b/tests/language_2/regress_24567_test.dart new file mode 100644 index 00000000000..8010da7a9d1 --- /dev/null +++ b/tests/language_2/regress_24567_test.dart @@ -0,0 +1,17 @@ +// Copyright (c) 2016, 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. + +import "package:expect/expect.dart"; +import 'dart:math' as math; + +class Random {} + +typedef F(Random r); + +main() { + f(Random r) {} + g(math.Random r) {} + Expect.isTrue(f is F); + Expect.isFalse(g is F); +} diff --git a/tests/language_2/regress_24935_test.dart b/tests/language_2/regress_24935_test.dart new file mode 100644 index 00000000000..430629f7434 --- /dev/null +++ b/tests/language_2/regress_24935_test.dart @@ -0,0 +1,23 @@ +// Copyright (c) 2016, 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. + +import 'dart:async'; + +S() => new Stream.fromIterable([1]); + +Future main() async { + L: + for (var s = 0; s < 10; s++) { + await for (var s1 in S()) { + await for (var s2 in S()) { + continue L; + } + } + } + // Regression check: make sure throwing an exception + // after breaking out of the innermost loop does not + // crash the VM. In other words, the expected test + // outcome is an unhandled exception. + throw "ball"; //# 01: runtime error +} diff --git a/tests/language_2/regress_25122_test.dart b/tests/language_2/regress_25122_test.dart new file mode 100644 index 00000000000..b7d4068feeb --- /dev/null +++ b/tests/language_2/regress_25122_test.dart @@ -0,0 +1,10 @@ +// Copyright (c) 2015, 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. + +main() {} + +class AbstractListMember> {} + +class RepoListMember> + extends AbstractListMember {} diff --git a/tests/language_2/regress_25246_1_test.dart b/tests/language_2/regress_25246_1_test.dart new file mode 100644 index 00000000000..2df6b056235 --- /dev/null +++ b/tests/language_2/regress_25246_1_test.dart @@ -0,0 +1,11 @@ +// Copyright (c) 2015, 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. + +import 'regress_25246_2.dart'; + +class ConcreteClass extends Object with MixIn {} + +void main() { + new ConcreteClass().test(); +} diff --git a/tests/language_2/regress_25246_2.dart b/tests/language_2/regress_25246_2.dart new file mode 100644 index 00000000000..736818c89cf --- /dev/null +++ b/tests/language_2/regress_25246_2.dart @@ -0,0 +1,12 @@ +// Copyright (c) 2015, 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. + +import 'regress_25246_3.dart'; + +class MixIn { + var test3 = new Test3(() {}); + void test() { + test3.test(); + } +} diff --git a/tests/language_2/regress_25246_3.dart b/tests/language_2/regress_25246_3.dart new file mode 100644 index 00000000000..ce61a2eaca9 --- /dev/null +++ b/tests/language_2/regress_25246_3.dart @@ -0,0 +1,11 @@ +// Copyright (c) 2015, 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. + +class Test3 { + final fn; + Test3(this.fn); + void test() { + fn(); + } +} diff --git a/tests/language_2/regress_25389_part.dart b/tests/language_2/regress_25389_part.dart new file mode 100644 index 00000000000..254c87baca7 --- /dev/null +++ b/tests/language_2/regress_25389_part.dart @@ -0,0 +1,14 @@ +// Copyright (c) 2016, 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. + +part of regress_25389; + +abstract class ComponentState> {} + +abstract class AbstractListEditorState> extends ComponentState {} + +class IssueListEditorState + extends AbstractListEditorState + implements ComponentState {} diff --git a/tests/language_2/regress_25389_test.dart b/tests/language_2/regress_25389_test.dart new file mode 100644 index 00000000000..f15bb0c495d --- /dev/null +++ b/tests/language_2/regress_25389_test.dart @@ -0,0 +1,14 @@ +// Copyright (c) 2016, 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. +// VMOptions=--error-on-bad-type + +library regress_25389; + +part 'regress_25389_part.dart'; + +main() { + new IssueListEditorState(); +} + +abstract class AbstractListEditor> {} diff --git a/tests/language_2/regress_25550_test.dart b/tests/language_2/regress_25550_test.dart new file mode 100644 index 00000000000..4a8a7c5954d --- /dev/null +++ b/tests/language_2/regress_25550_test.dart @@ -0,0 +1,17 @@ +// Copyright (c) 2016, 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. + +typedef int Adder(int a, int b); + +class Mock { + noSuchMethod(i) => null; +} + +class MockAdder extends Mock { + int call(int a, int b); +} + +main() { + Adder adder = new MockAdder(); +} diff --git a/tests/language_2/regress_25568_test.dart b/tests/language_2/regress_25568_test.dart new file mode 100644 index 00000000000..14d498672ab --- /dev/null +++ b/tests/language_2/regress_25568_test.dart @@ -0,0 +1,24 @@ +// Copyright (c) 2016, 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. + +main() { + var c1 = new BacklogListEditorState(); + var c2 = new BacklogsState(); +} + +class BacklogListEditorState + extends AbstractListEditorState {} + +class BacklogsState extends MutableEntityState {} + +abstract class AbstractListEditorState, + S extends AbstractListEditorState> extends ComponentState {} + +abstract class ComponentState> {} + +abstract class EntityState> + extends ComponentState {} + +abstract class MutableEntityState> + extends EntityState implements ComponentState {} diff --git a/tests/language_2/regress_25609_lib1.dart b/tests/language_2/regress_25609_lib1.dart new file mode 100644 index 00000000000..2be30116189 --- /dev/null +++ b/tests/language_2/regress_25609_lib1.dart @@ -0,0 +1,9 @@ +// Copyright (c) 2016, 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. + +library regress_25609_lib1; + +import 'regress_25609_lib2.dart'; + +typedef Bar Foo(int y); diff --git a/tests/language_2/regress_25609_lib2.dart b/tests/language_2/regress_25609_lib2.dart new file mode 100644 index 00000000000..d51c0614cb6 --- /dev/null +++ b/tests/language_2/regress_25609_lib2.dart @@ -0,0 +1,7 @@ +// Copyright (c) 2016, 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. + +library regress_25609_lib2; + +typedef void Bar(double x); diff --git a/tests/language_2/regress_25609_test.dart b/tests/language_2/regress_25609_test.dart new file mode 100644 index 00000000000..67b783c945c --- /dev/null +++ b/tests/language_2/regress_25609_test.dart @@ -0,0 +1,13 @@ +// Copyright (c) 2016, 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. + +// VMOptions=--error-on-bad-type + +import 'regress_25609_lib1.dart'; + +Foo baz() => null; + +main() { + baz(); +} diff --git a/tests/language_2/regress_25620_test.dart b/tests/language_2/regress_25620_test.dart new file mode 100644 index 00000000000..ed47189c1d5 --- /dev/null +++ b/tests/language_2/regress_25620_test.dart @@ -0,0 +1,8 @@ +// Copyright (c) 2016, 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. + +import "dart:async"; + +typedef Future SyncedExecutionFn(Future fn()); +main() {} diff --git a/tests/language_2/regress_25935_test.dart b/tests/language_2/regress_25935_test.dart new file mode 100644 index 00000000000..5b2e4e140bf --- /dev/null +++ b/tests/language_2/regress_25935_test.dart @@ -0,0 +1,25 @@ +// Copyright (c) 2016, 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. + +main() { + AddIssueSourceMember2 m = new AddIssueSourceMember2(); +} + +abstract class RepoListEditorState2, + S extends RepoListEditorState2> + extends AbstractListEditorState2 {} + +abstract class AbstractListEditorState2< + M extends AbstractListMember2, + S extends AbstractListEditorState2> extends ComponentState2 {} + +class AddIssueSourceMember2 extends RepoListMember2 {} + +class RepoListMember2> + extends AbstractListMember2 {} + +abstract class AbstractListMember2> + extends ComponentState2 {} + +abstract class ComponentState2> {} diff --git a/tests/language_2/regress_26133_test.dart b/tests/language_2/regress_26133_test.dart new file mode 100644 index 00000000000..7c657a1d573 --- /dev/null +++ b/tests/language_2/regress_26133_test.dart @@ -0,0 +1,15 @@ +// Copyright (c) 2016, 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. + +import 'dart:async'; + +var x = 'a'; + +Future foo() async { + return x; /*@compile-error=unspecified*/ +} + +main() { + foo(); +} diff --git a/tests/language_2/regress_26175_test.dart b/tests/language_2/regress_26175_test.dart new file mode 100644 index 00000000000..dd7ac2a46f9 --- /dev/null +++ b/tests/language_2/regress_26175_test.dart @@ -0,0 +1,74 @@ +// Copyright (c) 2015, 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. + +import 'dart:async'; + +import "package:expect/expect.dart"; +import "package:async_helper/async_helper.dart"; + +// Test that local variable reads and writes are sequenced correctly with +// respect to reads and writes in an awaited Future. See issue 26175. + +// Reads are sequenced correctly with respect to writes in a Future. +Future test1() async { + var x = 'a'; + f() async => x = 'b'; + Expect.equals('abb', '${x}${await f()}${x}'); +} + +// Writes are sequenced correctly with respect to writes in a Future. +Future test2(ignore) async { + var x; + f() async => x = 'b'; + Expect.equals('abb', '${x = 'a'}${await f()}${x}'); +} + +// Writes are sequenced correctly with respect to reads in a Future. +Future test3(ignore) async { + var x = 'a'; + f() async => x; + Expect.equals('bbb', '${x = 'b'}${await f()}${x}'); +} + +// Repeat the same tests for static variables. +var cell = 'a'; + +asyncReadCell() async => cell; +asyncWriteCell(value) async => cell = value; + +Future test4(ignore) async { + // This test assumes that it can read the initial value of cell. + Expect.equals('abb', '${cell}${await asyncWriteCell('b')}${cell}'); +} + +Future test5(ignore) async { + Expect.equals('abb', '${cell = 'a'}${await asyncWriteCell('b')}${cell}'); +} + +Future test6(ignore) async { + Expect.equals('bbb', '${cell = 'b'}${await asyncReadCell()}${cell}'); +} + +// Test that throwing is sequenced correctly with respect to other effects. +Future test7(ignore) async { + cell = 'a'; + try { + Expect.equals( + 'unreachable', '${throw 0}${await asyncWriteCell('b')}${cell}'); + } catch (_) { + Expect.equals('a', cell); + } +} + +main() { + asyncStart(); + test1() + .then(test2) + .then(test3) + .then(test4) + .then(test5) + .then(test6) + .then(test7) + .then((_) => asyncEnd()); +} diff --git a/tests/language_2/regress_26230_test.dart b/tests/language_2/regress_26230_test.dart new file mode 100644 index 00000000000..77792bc4eb5 --- /dev/null +++ b/tests/language_2/regress_26230_test.dart @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 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. + +class _RenderTabBar extends RenderBox + with + ContainerRenderObjectMixin, + RenderBoxContainerDefaultsMixin {} + +class RenderObject {} + +class RenderSector extends RenderObject {} + +class RenderBox extends RenderObject {} + +class ParentData {} + +class BoxParentData extends ParentData {} + +class SectorParentData extends ParentData {} + +class ContainerParentDataMixin {} + +class ContainerRenderObjectMixin> {} + +class SectorChildListParentData extends SectorParentData + with ContainerParentDataMixin {} + +class RenderDecoratedSector extends RenderSector {} + +class RenderSectorWithChildren extends RenderDecoratedSector + with ContainerRenderObjectMixin {} + +class ContainerBoxParentDataMixin + extends BoxParentData with ContainerParentDataMixin {} + +class RenderBoxContainerDefaultsMixin> + implements ContainerRenderObjectMixin {} + +class FlexParentData extends ContainerBoxParentDataMixin {} + +class _TabBarParentData extends ContainerBoxParentDataMixin {} + +main() { + new _RenderTabBar(); +} diff --git a/tests/language_2/regress_26453_test.dart b/tests/language_2/regress_26453_test.dart new file mode 100644 index 00000000000..32d6f599234 --- /dev/null +++ b/tests/language_2/regress_26453_test.dart @@ -0,0 +1,33 @@ +// Copyright (c) 2016, 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. + +// The program crashed with segfault because we when we first compile foo +// and bar we allocate all four variables (a, b, c and d) to the context. +// When we compile foo the second time (with optimizations) we allocate +// only c and d to the context. This happened because parser folds away +// "${a}" and "${b}" as constant expressions when parsing bar on its own, +// i.e. the expressions were not parsed again and thus a and b were not +// marked as captured. +// This caused a mismatch between a context that bar expects and that +// the optimized version of foo produces. + +foo() { + const a = 1; + const b = 2; + var c = 3; + var d = 4; + + bar() { + if ("${a}" != "1") throw "failed"; + if ("${b}" != "2") throw "failed"; + if ("${c}" != "3") throw "failed"; + if ("${d}" != "4") throw "failed"; + } + + bar(); +} + +main() { + for (var i = 0; i < 50000; i++) foo(); +} diff --git a/tests/language_2/regress_26530_test.dart b/tests/language_2/regress_26530_test.dart new file mode 100644 index 00000000000..ab22638fb97 --- /dev/null +++ b/tests/language_2/regress_26530_test.dart @@ -0,0 +1,32 @@ +// Copyright (c) 2016, 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. + +import "package:expect/expect.dart"; + +var trace = ""; + +main() { + var x = 0; + try { + try { + throw x++; // 1 + } on int catch (e) { + trace += "$e"; + trace += "-$x"; + x++; // 2 + try { + x++; // 3 + rethrow; + } finally { + trace += "-f"; + x++; // 4 + } + } + } catch (e) { + trace += "-c"; + trace += "-$e"; + trace += "-$x"; + } + Expect.equals("0-1-f-c-0-4", trace); +} diff --git a/tests/language_2/regress_26543_1_test.dart b/tests/language_2/regress_26543_1_test.dart new file mode 100644 index 00000000000..39305f67cdb --- /dev/null +++ b/tests/language_2/regress_26543_1_test.dart @@ -0,0 +1,14 @@ +// Copyright (c) 2016, 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. + +// Regression test for issue 26543 + +class C { + var x; + C() : x = null ?? {} {} +} + +main() { + print(new C()); +} diff --git a/tests/language_2/regress_26543_2_test.dart b/tests/language_2/regress_26543_2_test.dart new file mode 100644 index 00000000000..ac7b5f5cc3a --- /dev/null +++ b/tests/language_2/regress_26543_2_test.dart @@ -0,0 +1,16 @@ +// Copyright (c) 2016, 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. + +// Regression test for issue 26543 + +class C { + var x, y; + C() + : x = null ?? {}, + y = 0 {} +} + +main() { + print(new C()); +} diff --git a/tests/language_2/regress_26543_3_test.dart b/tests/language_2/regress_26543_3_test.dart new file mode 100644 index 00000000000..91bbfa4dcfb --- /dev/null +++ b/tests/language_2/regress_26543_3_test.dart @@ -0,0 +1,16 @@ +// Copyright (c) 2016, 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. + +// Regression test for issue 26543 + +class C { + var x, y; + C() + : x = 0, + y = null ?? {} {} +} + +main() { + print(new C()); +} diff --git a/tests/language_2/regress_26668_test.dart b/tests/language_2/regress_26668_test.dart new file mode 100644 index 00000000000..4a2945873bd --- /dev/null +++ b/tests/language_2/regress_26668_test.dart @@ -0,0 +1,16 @@ +// Copyright (c) 2016, 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. + +import 'dart:async'; + +main() async { + var myClass = new CustomClass(); + await myClass.processData(); +} + +class CustomClass { + Future processData() async { + return null; + } +} diff --git a/tests/language_2/regress_26855_test.dart b/tests/language_2/regress_26855_test.dart new file mode 100644 index 00000000000..0377fa322d5 --- /dev/null +++ b/tests/language_2/regress_26855_test.dart @@ -0,0 +1,25 @@ +// Copyright (c) 2016, 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. + +void f0(this.x) {} // //# 0: compile-time error + +void f1(int g(this.x)) {} // //# 1: compile-time error + +void f2(int g(int this.x)) {} // //# 2: compile-time error + +class C { + C(); + var x; + void f3(int g(this.x)) {} // //# 3: compile-time error + C.f4(int g(this.x)); // //# 4: compile-time error +} + +main() { + f0(null); // //# 0: continued + f1(null); // //# 1: continued + f2(null); // //# 2: continued + C c = new C(); + c.f3(null); // //# 3: continued + new C.f4(null); // //# 4: continued +} diff --git a/tests/language_2/regress_26948_test.dart b/tests/language_2/regress_26948_test.dart new file mode 100644 index 00000000000..c37d3f74b22 --- /dev/null +++ b/tests/language_2/regress_26948_test.dart @@ -0,0 +1,26 @@ +// Copyright (c) 2016, 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. +// VMOptions=--optimization-counter-threshold=10 --no-background-compilation + +import 'dart:async'; +import "package:expect/expect.dart"; + +void check(Function f) { + Expect.isTrue(f()); +} + +Future doSync() async { + try { + await 123; + } finally { + var next = 5.0; + check(() => next == 5.0); + } +} + +main() async { + for (int i = 0; i < 20; i++) { + await doSync(); + } +} diff --git a/tests/language_2/regress_27164_test.dart b/tests/language_2/regress_27164_test.dart new file mode 100644 index 00000000000..a71873cc987 --- /dev/null +++ b/tests/language_2/regress_27164_test.dart @@ -0,0 +1,19 @@ +// Copyright (c) 2016, 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. + +// Regression test for issue 27164. + +import 'package:expect/expect.dart'; + +String simpleEcho(String arg) => arg; + +class Echo { + final echo; + // Check that the expression simpleEcho is a compile-time constant. + const Echo() : echo = simpleEcho; +} + +void main() { + Expect.equals("hello", const Echo().echo("hello")); +} diff --git a/tests/language_2/regress_27572_test.dart b/tests/language_2/regress_27572_test.dart new file mode 100644 index 00000000000..398fdb9af59 --- /dev/null +++ b/tests/language_2/regress_27572_test.dart @@ -0,0 +1,14 @@ +// Copyright (c) 2016, 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. + +// Test has been modified and doesn't test http://dartbug.com/275272 anymore. +// Static unresolved calls are not allowed anymore. + +import "package:expect/expect.dart"; + +import 'dart:collection' as col; + +main() { + col.foobar(1234567); /*@compile-error=unspecified*/ +} diff --git a/tests/language_2/regress_27617_test.dart b/tests/language_2/regress_27617_test.dart new file mode 100644 index 00000000000..960d987b73c --- /dev/null +++ b/tests/language_2/regress_27617_test.dart @@ -0,0 +1,15 @@ +// Copyright (c) 2016, 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. + +class Foo { + final String greeting; + Foo._(this.greeting) {} + + // Const constructor must not redirect to non-const constructor. + const Foo.hi() : this._('hi'); // //# 1: compile-time error +} + +main() { + const h = const Foo.hi(); // //# 1: continued +} diff --git a/tests/language_2/regress_27659_test.dart b/tests/language_2/regress_27659_test.dart new file mode 100644 index 00000000000..e40a8866991 --- /dev/null +++ b/tests/language_2/regress_27659_test.dart @@ -0,0 +1,28 @@ +// Copyright (c) 2016, 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. + +const String lineLength = '120'; + +foo({lineLength: lineLength}) { + print(lineLength); +} + +bar({lineLength: lineLength}) async { + print(lineLength); +} + +baz([lineLength = lineLength]) { + print(lineLength); +} + +qux([lineLength = lineLength]) async { + print(lineLength); +} + +main() { + foo(); + bar(); + baz(); + qux(); +} diff --git a/tests/language_2/regress_27700_test.dart b/tests/language_2/regress_27700_test.dart new file mode 100644 index 00000000000..c5bacecdfc0 --- /dev/null +++ b/tests/language_2/regress_27700_test.dart @@ -0,0 +1,10 @@ +// 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. + +// Regression test for issue 27700. + +main() { + var x = new List(0); + var z = "$x"; +} diff --git a/tests/language_2/regress_27957_lib1.dart b/tests/language_2/regress_27957_lib1.dart new file mode 100644 index 00000000000..7a06ff38f06 --- /dev/null +++ b/tests/language_2/regress_27957_lib1.dart @@ -0,0 +1,9 @@ +// Copyright (c) 2016, 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. + +library regress_27957_lib1; + +class Superclass { + int m() => 1; +} diff --git a/tests/language_2/regress_27957_lib2.dart b/tests/language_2/regress_27957_lib2.dart new file mode 100644 index 00000000000..24097d09f8a --- /dev/null +++ b/tests/language_2/regress_27957_lib2.dart @@ -0,0 +1,9 @@ +// Copyright (c) 2016, 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. + +library regress_27957_lib2; + +class Superclass { + int m() => 2; +} diff --git a/tests/language_2/regress_27957_test.dart b/tests/language_2/regress_27957_test.dart new file mode 100644 index 00000000000..3efa497e2ac --- /dev/null +++ b/tests/language_2/regress_27957_test.dart @@ -0,0 +1,18 @@ +// Copyright (c) 2016, 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. + +import "package:expect/expect.dart"; +import 'regress_27957_lib1.dart' as s1; +import 'regress_27957_lib2.dart' as s2; + +class Mixin {} + +class C1 = s1.Superclass with Mixin; +class C2 = s2.Superclass with Mixin; + +main() { + var c1 = new C1(), c2 = new C2(); + Expect.equals(1, c1.m()); + Expect.equals(2, c2.m()); +} diff --git a/tests/language_2/regress_28217_test.dart b/tests/language_2/regress_28217_test.dart new file mode 100644 index 00000000000..a49876fad33 --- /dev/null +++ b/tests/language_2/regress_28217_test.dart @@ -0,0 +1,14 @@ +// 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. + +// Test non-existing redirecting constructor and +// redirecting to a factory constructor. + +class B { + B() : this.a(); // //# none: compile-time error + factory B.a() {} // //# 01: compile-time error + B.a(); // //# 02: ok +} + +main() => new B(); diff --git a/tests/language_2/regress_28255_test.dart b/tests/language_2/regress_28255_test.dart new file mode 100644 index 00000000000..0441e8be320 --- /dev/null +++ b/tests/language_2/regress_28255_test.dart @@ -0,0 +1,23 @@ +// 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. + +// Regression test for issue 28255 + +import 'dart:mirrors'; +import 'package:expect/expect.dart'; + +class Class { + noSuchMethod(i) => true; + + foo() { + dynamic o = this; + Expect.isFalse(o.bar is Null); + Expect.isTrue(o.bar != null); + Expect.equals(true.runtimeType, o.bar.runtimeType); + } +} + +main() { + reflectClass(Class).newInstance(const Symbol(''), []).reflectee.foo(); +} diff --git a/tests/language_2/regress_28278_lib.dart b/tests/language_2/regress_28278_lib.dart new file mode 100644 index 00000000000..0bc67f1e3b3 --- /dev/null +++ b/tests/language_2/regress_28278_lib.dart @@ -0,0 +1,5 @@ +// 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. + +foo(x) => x + "Hello"; diff --git a/tests/language_strong/language_strong.status b/tests/language_strong/language_strong.status index b9888ce11cb..da028fc3a23 100644 --- a/tests/language_strong/language_strong.status +++ b/tests/language_strong/language_strong.status @@ -184,10 +184,6 @@ regress_20394_test: Skip regress_21793_test: Skip regress_21912_test: Skip regress_22438_test: Skip -regress_22936_test: Skip -regress_23038_test: Skip -regress_23051_test: Skip -regress_23408_test: Skip return_type_test: Skip rewrite_implicit_this_test: Skip setter4_test: Skip @@ -263,14 +259,12 @@ internal_library_test/02: MissingStaticWarning # Issue 28823 main_not_a_function_test/01: MissingStaticWarning # Issue 28823 main_test/03: MissingStaticWarning # Issue 28823 no_main_test/01: MissingStaticWarning # Issue 28823 -regress_23089_test: CompileTimeError # Issue 28823 reify_typevar_static_test/00: MissingCompileTimeError # Issue 28823 super_setter_test: StaticWarning # Issue 28823 try_catch4_test: StaticWarning # Issue 28823 try_catch5_test: StaticWarning # Issue 28823 [ $compiler == dartdevc ] -regress_23089_test: CompileTimeError # Issue 29920 reify_typevar_static_test/00: MissingCompileTimeError # Issue 29920 [ $compiler == dartdevc && $runtime != none ] @@ -300,7 +294,6 @@ mint_arithmetic_test: RuntimeError # Issue 29920 nan_identical_test: RuntimeError # Issue 29920 nested_switch_label_test: RuntimeError # Issue 29920 regress_16640_test: RuntimeError # Issue 29920 -regress_22443_test: RuntimeError # Issue 29920 stack_overflow_stacktrace_test: RuntimeError # Issue 29920 stack_overflow_test: RuntimeError # Issue 29920 stacktrace_test: RuntimeError # Issue 29920 diff --git a/tests/language_strong/language_strong_kernel.status b/tests/language_strong/language_strong_kernel.status index a86278aa7ab..ec60ecfcb00 100644 --- a/tests/language_strong/language_strong_kernel.status +++ b/tests/language_strong/language_strong_kernel.status @@ -28,8 +28,6 @@ main_not_a_function_test/01: DartkCrash mixin_generic_test: RuntimeError recursive_generic_test: RuntimeError redirecting_factory_reflection_test: RuntimeError -regress_22443_test: RuntimeError -regress_22700_test: RuntimeError regress_r24720_test: RuntimeError reify_typevar_static_test/00: MissingCompileTimeError reify_typevar_test: RuntimeError