mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 10:10:22 +00:00
Switch server tests to strong mode.
R=brianwilkerson@google.com BUG= Review-Url: https://codereview.chromium.org/2903523003 .
This commit is contained in:
parent
e6c38ea30f
commit
ab9ee72a34
7 changed files with 22 additions and 24 deletions
|
@ -290,8 +290,8 @@ class AssistProcessor {
|
|||
_coverageMarker();
|
||||
return;
|
||||
}
|
||||
// prepare propagated type
|
||||
DartType type = name.propagatedType;
|
||||
// prepare the type
|
||||
DartType type = parameter.element.type;
|
||||
// TODO(scheglov) If the parameter is in a method declaration, and if the
|
||||
// method overrides a method that has a type for the corresponding
|
||||
// parameter, it would be nice to copy down the type from the overridden
|
||||
|
|
|
@ -167,7 +167,7 @@ class Required {
|
|||
_fileContentOverlay,
|
||||
null,
|
||||
sourceFactory,
|
||||
new AnalysisOptionsImpl());
|
||||
new AnalysisOptionsImpl()..strongMode = true);
|
||||
scheduler.start();
|
||||
} else {
|
||||
_context = AnalysisEngine.instance.createAnalysisContext();
|
||||
|
|
|
@ -332,7 +332,7 @@ class A {
|
|||
expect(location.startColumn, 16);
|
||||
}
|
||||
expect(element.parameters, isNull);
|
||||
expect(element.returnType, 'dynamic');
|
||||
expect(element.returnType, 'int');
|
||||
expect(element.flags, Element.FLAG_CONST | Element.FLAG_STATIC);
|
||||
}
|
||||
|
||||
|
|
|
@ -56,15 +56,6 @@ void f(Derived d) {
|
|||
return new TypeMemberContributor();
|
||||
}
|
||||
|
||||
fail_test_PrefixedIdentifier_trailingStmt_const_untyped() async {
|
||||
// SimpleIdentifier PrefixedIdentifier ExpressionStatement
|
||||
addTestSource('const g = "hello"; f() {g.^ int y = 0;}');
|
||||
await computeSuggestions();
|
||||
assertSuggestMethod('toString', 'Object', 'String');
|
||||
// fails this assertion because type of const is not properly inferred
|
||||
assertSuggestGetter('length', 'int');
|
||||
}
|
||||
|
||||
test_ArgDefaults_method() async {
|
||||
addTestSource('''
|
||||
class A {
|
||||
|
@ -3561,6 +3552,14 @@ void main() {C.^ print("something");}''');
|
|||
assertSuggestGetter('length', 'int');
|
||||
}
|
||||
|
||||
test_PrefixedIdentifier_trailingStmt_const_untyped() async {
|
||||
// SimpleIdentifier PrefixedIdentifier ExpressionStatement
|
||||
addTestSource('const g = "hello"; f() {g.^ int y = 0;}');
|
||||
await computeSuggestions();
|
||||
assertSuggestMethod('toString', 'Object', 'String');
|
||||
assertSuggestGetter('length', 'int');
|
||||
}
|
||||
|
||||
test_PrefixedIdentifier_trailingStmt_field() async {
|
||||
// SimpleIdentifier PrefixedIdentifier ExpressionStatement
|
||||
addTestSource('class A {String g; f() {g.^ int y = 0;}}');
|
||||
|
|
|
@ -3828,6 +3828,7 @@ final V = 1;
|
|||
}
|
||||
|
||||
test_reparentFlutterList_BAD_multiLine() async {
|
||||
verifyNoTestUnitErrors = false;
|
||||
_configureFlutterPkg({
|
||||
'src/widgets/framework.dart': flutter_framework_code,
|
||||
});
|
||||
|
|
|
@ -894,7 +894,7 @@ main(int k) {
|
|||
await indexTestUnit('''
|
||||
var X = 1;
|
||||
|
||||
var Y = () {
|
||||
dynamic Y = () {
|
||||
return 1 + X;
|
||||
};
|
||||
''');
|
||||
|
@ -903,11 +903,11 @@ var Y = () {
|
|||
return _assertSuccessfulRefactoring('''
|
||||
var X = 1;
|
||||
|
||||
var Y = () {
|
||||
dynamic Y = () {
|
||||
return res();
|
||||
};
|
||||
|
||||
num res() => 1 + X;
|
||||
int res() => 1 + X;
|
||||
''');
|
||||
}
|
||||
|
||||
|
|
|
@ -100,10 +100,10 @@ class A {
|
|||
await indexTestUnit('''
|
||||
class A {
|
||||
A() {} // marker
|
||||
factory A._() = A;
|
||||
}
|
||||
class B extends A {
|
||||
B() : super() {}
|
||||
factory B._() = A;
|
||||
}
|
||||
main() {
|
||||
new A();
|
||||
|
@ -119,10 +119,10 @@ main() {
|
|||
return assertSuccessfulRefactoring('''
|
||||
class A {
|
||||
A.newName() {} // marker
|
||||
factory A._() = A.newName;
|
||||
}
|
||||
class B extends A {
|
||||
B() : super.newName() {}
|
||||
factory B._() = A.newName;
|
||||
}
|
||||
main() {
|
||||
new A.newName();
|
||||
|
@ -136,7 +136,6 @@ class A {
|
|||
}
|
||||
class B extends A {
|
||||
B() : super() {}
|
||||
factory B._() = A;
|
||||
}
|
||||
main() {
|
||||
new A();
|
||||
|
@ -155,7 +154,6 @@ class A {
|
|||
}
|
||||
class B extends A {
|
||||
B() : super.newName() {}
|
||||
factory B._() = A.newName;
|
||||
}
|
||||
main() {
|
||||
new A.newName();
|
||||
|
@ -167,10 +165,10 @@ main() {
|
|||
await indexTestUnit('''
|
||||
class A {
|
||||
A.test() {} // marker
|
||||
factory A._() = A.test;
|
||||
}
|
||||
class B extends A {
|
||||
B() : super.test() {}
|
||||
factory B._() = A.test;
|
||||
}
|
||||
main() {
|
||||
new A.test();
|
||||
|
@ -186,10 +184,10 @@ main() {
|
|||
return assertSuccessfulRefactoring('''
|
||||
class A {
|
||||
A.newName() {} // marker
|
||||
factory A._() = A.newName;
|
||||
}
|
||||
class B extends A {
|
||||
B() : super.newName() {}
|
||||
factory B._() = A.newName;
|
||||
}
|
||||
main() {
|
||||
new A.newName();
|
||||
|
@ -201,10 +199,10 @@ main() {
|
|||
await indexTestUnit('''
|
||||
class A {
|
||||
A.test() {} // marker
|
||||
factory A._() = A.test;
|
||||
}
|
||||
class B extends A {
|
||||
B() : super.test() {}
|
||||
factory B._() = A.test;
|
||||
}
|
||||
main() {
|
||||
new A.test();
|
||||
|
@ -220,10 +218,10 @@ main() {
|
|||
return assertSuccessfulRefactoring('''
|
||||
class A {
|
||||
A() {} // marker
|
||||
factory A._() = A;
|
||||
}
|
||||
class B extends A {
|
||||
B() : super() {}
|
||||
factory B._() = A;
|
||||
}
|
||||
main() {
|
||||
new A();
|
||||
|
|
Loading…
Reference in a new issue