Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(552)

Unified Diff: pkg/analyzer/test/src/task/strong_mode_test.dart

Issue 1850623005: Issue 26147. Don't attempt to set the type of the parameter for setters without parameters. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/task/strong_mode.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong_mode_test.dart
diff --git a/pkg/analyzer/test/src/task/strong_mode_test.dart b/pkg/analyzer/test/src/task/strong_mode_test.dart
index 097d5d433335fd547f7b22dfc413d5e09616e242..b7b86e3983ccce4a2f442d588836c9b3acb74561 100644
--- a/pkg/analyzer/test/src/task/strong_mode_test.dart
+++ b/pkg/analyzer/test/src/task/strong_mode_test.dart
@@ -18,6 +18,7 @@ import '../context/abstract_context.dart';
main() {
initializeTestEnvironment();
runReflectiveTests(InstanceMemberInferrerTest);
+ runReflectiveTests(SetFieldTypeTest);
runReflectiveTests(VariableGathererTest);
}
@@ -982,6 +983,23 @@ class B extends A {
}
@reflectiveTest
+class SetFieldTypeTest extends AbstractContextTest {
+ void test_setter_withoutParameter() {
+ CompilationUnitElement unit = _resolve('''
+var x = 0;
+set x() {}
+''');
+ TopLevelVariableElement variable = unit.topLevelVariables.single;
+ setFieldType(variable, context.typeProvider.intType);
+ }
+
+ CompilationUnitElement _resolve(String content) {
+ Source source = addSource('/test.dart', content);
+ return context.resolveCompilationUnit2(source, source).element;
+ }
+}
+
+@reflectiveTest
class VariableGathererTest extends AbstractContextTest {
void test_creation_withFilter() {
VariableFilter filter = (variable) => true;
« no previous file with comments | « pkg/analyzer/lib/src/task/strong_mode.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698