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

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

Issue 1711673003: Synthetic constructors resulting from mixins should never be const (issue 25738) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: cleanup Created 4 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
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.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/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 9c4f87c851354d93be77986d8ac4b3e51f255c45..7c0c15adb3ea2c31093a0760f848b482c055c40e 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -1462,6 +1462,23 @@ f() { return const T(0, 1, c: 2, d: 3); }''');
verify([source]);
}
+ void test_constWithNonConst_with() {
+ Source source = addSource(r'''
+class B {
+ const B();
+}
+class C = B with M;
+class M {}
+const x = const C();
+main() {
+ print(x);
+}
+''');
+ computeLibrarySourceErrors(source);
+ assertErrors(source, [CompileTimeErrorCode.CONST_WITH_NON_CONST]);
+ verify([source]);
+ }
+
void test_constWithNonConstantArgument_annotation() {
Source source = addSource(r'''
class A {
@@ -1669,24 +1686,6 @@ class A {}''');
verify([librarySource, sourceA, sourceB]);
}
- void test_duplicateDefinition_inPart() {
- Source librarySource = addNamedSource(
- "/lib.dart",
- r'''
-library test;
-part 'a.dart';
-class A {}''');
- Source sourceA = addNamedSource(
- "/a.dart",
- r'''
-part of test;
-class A {}''');
- computeLibrarySourceErrors(librarySource);
- assertErrors(sourceA, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
- assertNoErrors(librarySource);
- verify([librarySource, sourceA]);
- }
-
void test_duplicateDefinition_catch() {
Source source = addSource(r'''
main() {
@@ -1730,6 +1729,24 @@ class A {
verify([source]);
}
+ void test_duplicateDefinition_inPart() {
+ Source librarySource = addNamedSource(
+ "/lib.dart",
+ r'''
+library test;
+part 'a.dart';
+class A {}''');
+ Source sourceA = addNamedSource(
+ "/a.dart",
+ r'''
+part of test;
+class A {}''');
+ computeLibrarySourceErrors(librarySource);
+ assertErrors(sourceA, [CompileTimeErrorCode.DUPLICATE_DEFINITION]);
+ assertNoErrors(librarySource);
+ verify([librarySource, sourceA]);
+ }
+
void test_duplicateDefinition_locals_inCase() {
Source source = addSource(r'''
main() {
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698