mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 08:44:27 +00:00
Move test infer_use_of_void to inference_new
This test's expectations reflect a drawback in analyzer's type inference--it doesn't infer the correct types for calls to methods returning `void` when those calls occur outside of a method body. The new front_end type inference engine does the right thing. Accordingly, we have to move the test to inference_new, so that we can update its expectations without breaking analyzer's test code. R=ahe@google.com Review-Url: https://codereview.chromium.org/2953903002 .
This commit is contained in:
parent
c68e5cc67d
commit
c4ecf098aa
13 changed files with 108 additions and 5 deletions
|
@ -199,7 +199,6 @@ inference/infer_types_on_generic_instantiations_in_library_cycle_a: Fail
|
|||
inference/infer_types_on_generic_instantiations_infer: Fail
|
||||
inference/infer_types_on_loop_indices_for_each_loop: Fail
|
||||
inference/infer_types_on_loop_indices_for_loop_with_inference: Fail
|
||||
inference/infer_use_of_void: Fail
|
||||
inference/infer_variable_void: Fail
|
||||
inference/inferred_initializing_formal_checks_default_value: Fail
|
||||
inference/inferred_nonstatic_field_depends_on_static_field_complex: Fail
|
||||
|
|
|
@ -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.
|
||||
|
||||
/*@testedFeatures=inference*/
|
||||
library test;
|
||||
|
||||
void f() {}
|
||||
|
||||
void g() {
|
||||
var /*@type=void*/ x = f();
|
||||
}
|
||||
|
||||
main() {}
|
|
@ -0,0 +1,8 @@
|
|||
library test;
|
||||
import self as self;
|
||||
|
||||
static method f() → void {}
|
||||
static method g() → void {
|
||||
dynamic x = self::f();
|
||||
}
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,8 @@
|
|||
library test;
|
||||
import self as self;
|
||||
|
||||
static method f() → void {}
|
||||
static method g() → void {
|
||||
dynamic x = self::f();
|
||||
}
|
||||
static method main() → dynamic {}
|
|
@ -0,0 +1,9 @@
|
|||
library test;
|
||||
import self as self;
|
||||
|
||||
static method f() → void
|
||||
;
|
||||
static method g() → void
|
||||
;
|
||||
static method main() → dynamic
|
||||
;
|
|
@ -0,0 +1,8 @@
|
|||
library test;
|
||||
import self as self;
|
||||
|
||||
static method f() → void {}
|
||||
static method g() → void {
|
||||
void x = self::f();
|
||||
}
|
||||
static method main() → dynamic {}
|
|
@ -13,7 +13,7 @@ class C extends B {
|
|||
/*@topType=void*/ f() {}
|
||||
}
|
||||
|
||||
var /*@topType=dynamic*/ x =
|
||||
var /*@topType=void*/ x =
|
||||
new C(). /*info:USE_OF_VOID_RESULT*/ /*@target=C::f*/ f();
|
||||
|
||||
main() {
|
|
@ -0,0 +1,20 @@
|
|||
library test;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class B extends core::Object {
|
||||
constructor •() → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
method f() → void {}
|
||||
}
|
||||
class C extends self::B {
|
||||
constructor •() → void
|
||||
: super self::B::•()
|
||||
;
|
||||
method f() → dynamic {}
|
||||
}
|
||||
static field dynamic x = new self::C::•().f();
|
||||
static method main() → dynamic {
|
||||
self::x;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
library test;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class B extends core::Object {
|
||||
constructor •() → void
|
||||
;
|
||||
method f() → void
|
||||
;
|
||||
}
|
||||
class C extends self::B {
|
||||
constructor •() → void
|
||||
;
|
||||
method f() → dynamic
|
||||
;
|
||||
}
|
||||
static field dynamic x;
|
||||
static method main() → dynamic
|
||||
;
|
|
@ -0,0 +1,20 @@
|
|||
library test;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class B extends core::Object {
|
||||
constructor •() → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
method f() → void {}
|
||||
}
|
||||
class C extends self::B {
|
||||
constructor •() → void
|
||||
: super self::B::•()
|
||||
;
|
||||
method f() → void {}
|
||||
}
|
||||
static field void x = new self::C::•().{self::C::f}();
|
||||
static method main() → dynamic {
|
||||
self::x;
|
||||
}
|
|
@ -280,7 +280,6 @@ inference/infer_types_on_generic_instantiations_in_library_cycle_a: Crash
|
|||
inference/infer_types_on_generic_instantiations_infer: Crash
|
||||
inference/infer_types_on_loop_indices_for_each_loop: Crash
|
||||
inference/infer_types_on_loop_indices_for_loop_with_inference: Fail
|
||||
inference/infer_use_of_void: Crash
|
||||
inference/infer_variable_void: Crash
|
||||
inference/inferred_initializing_formal_checks_default_value: Crash
|
||||
inference/inferred_nonstatic_field_depends_on_static_field_complex: Crash
|
||||
|
@ -400,6 +399,7 @@ inference_new/infer_assign_to_ref: Crash
|
|||
inference_new/infer_instance_accessor_ref: Crash
|
||||
inference_new/infer_instance_field_ref: Crash
|
||||
inference_new/infer_instance_field_ref_circular: Crash
|
||||
inference_new/infer_use_of_void: Crash
|
||||
inference_new/property_get_toplevel: Crash
|
||||
inference_new/strongly_connected_component: Crash
|
||||
|
||||
|
|
|
@ -179,7 +179,6 @@ inference/infer_types_on_generic_instantiations_in_library_cycle_a: Fail
|
|||
inference/infer_types_on_generic_instantiations_infer: Fail
|
||||
inference/infer_types_on_loop_indices_for_each_loop: Fail
|
||||
inference/infer_types_on_loop_indices_for_loop_with_inference: Fail
|
||||
inference/infer_use_of_void: Fail
|
||||
inference/infer_variable_void: Fail
|
||||
inference/inferred_initializing_formal_checks_default_value: Fail
|
||||
inference/inferred_nonstatic_field_depends_on_static_field_complex: Fail
|
||||
|
|
|
@ -58,7 +58,6 @@ inference/downwards_inference_on_function_of_t_using_the_t: Fail
|
|||
inference/future_then_explicit_future: Fail
|
||||
inference/generic_functions_return_typedef: Fail
|
||||
inference/generic_methods_infer_js_builtin: Fail
|
||||
inference/infer_use_of_void: Fail
|
||||
inference/list_literals_can_infer_null_top_level: Fail
|
||||
inference/map_literals_can_infer_null_top_level: Fail
|
||||
inference/property_set: Fail
|
||||
|
|
Loading…
Reference in a new issue