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

Unified Diff: pkg/analyzer/test/generated/compile_time_error_code_test.dart

Issue 2716453006: Add error for mixins defining conflicting private names (issue 28809) (Closed)
Patch Set: Created 3 years, 10 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
Index: pkg/analyzer/test/generated/compile_time_error_code_test.dart
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
index 3c95c9da539709978d5e16b8590aa375545af459..614f720ff694c6cb324ba0e8d39546a99b430bbe 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -5263,6 +5263,95 @@ f() {
verify([source]);
}
+ test_privateCollisionInMixinApplication_mixinAndMixin() async {
+ addNamedSource(
+ '/lib1.dart',
+ '''
+class A {
+ int _x;
+}
+
+class B {
+ int _x;
+}
+''');
+ Source source = addSource('''
+import 'lib1.dart';
+class C extends Object with A, B {}
+''');
+ await computeAnalysisResult(source);
+ assertErrors(
+ source, [CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION]);
+ verify([source]);
+ }
+
+ test_privateCollisionInMixinApplication_mixinAndMixin_indirect() async {
+ addNamedSource(
+ '/lib1.dart',
+ '''
+class A {
+ int _x;
+}
+
+class B {
+ int _x;
+}
+''');
+ Source source = addSource('''
+import 'lib1.dart';
+class C extends Object with A {}
+class D extends C with B {}
+''');
+ await computeAnalysisResult(source);
+ assertErrors(
+ source, [CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION]);
+ verify([source]);
+ }
+
+ test_privateCollisionInMixinApplication_superclassAndMixin() async {
+ addNamedSource(
+ '/lib1.dart',
+ '''
+class A {
+ int _x;
+}
+
+class B {
+ int _x;
+}
+''');
+ Source source = addSource('''
+import 'lib1.dart';
+class C extends A with B {}
+''');
+ await computeAnalysisResult(source);
+ assertErrors(
+ source, [CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION]);
+ verify([source]);
+ }
+
+ test_privateCollisionInMixinApplication_superclassAndMixin_same() async {
+ addNamedSource(
+ '/lib1.dart',
+ '''
+class A {
+ int _x;
+}
+
+class B {
+ int _x;
+}
+''');
+ Source source = addSource('''
+import 'lib1.dart';
+class C extends A with A {}
+''');
+ await computeAnalysisResult(source);
+ assertErrors(
+ source, [CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION]);
+ verify([source]);
+ }
+
test_privateOptionalParameter() async {
Source source = addSource("f({var _p}) {}");
await computeAnalysisResult(source);
« pkg/analyzer/lib/src/error/codes.dart ('K') | « pkg/analyzer/lib/src/generated/error_verifier.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698