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

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

Issue 2837743002: Issue 29432. Instantiate the redirect constructor with the in-scope type arguments. (Closed)
Patch Set: Created 3 years, 8 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 1b755f930fd27531eb65954579648e77d48b0f6b..c71d7915fb642227219efc65afc8991789be056e 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -889,6 +889,23 @@ foo(var p) {
verify([source]);
}
+ test_constConstructor_redirect_generic() async {
+ Source source = addSource(r'''
+class A<T> {
+ const A(T value) : this._(value);
+ const A._(T value) : value = value;
+ final T value;
+}
+
+void main(){
+ const A<int>(1);
+}
+''');
+ await computeAnalysisResult(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
test_constConstructorWithFieldInitializedByNonConst() async {
Source source = addSource(r'''
class A {
@@ -1260,25 +1277,6 @@ class A {
verify([source]);
}
- test_nonConstValueInInitializer_instanceCreation_inDifferentFile() async {
- resetWith(options: new AnalysisOptionsImpl()..strongMode = true);
- Source source = addNamedSource(
- '/a.dart',
- r'''
-import 'b.dart';
-const v = const MyClass();
-''');
- addNamedSource(
- '/b.dart',
- r'''
-class MyClass {
- const MyClass([p = foo]);
-}
-''');
- await computeAnalysisResult(source);
- assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
- }
-
test_constInitializedWithNonConstValue() async {
Source source = addSource(r'''
f(p) {
@@ -4803,6 +4801,25 @@ var b = const B();''');
verify([source]);
}
+ test_nonConstValueInInitializer_instanceCreation_inDifferentFile() async {
+ resetWith(options: new AnalysisOptionsImpl()..strongMode = true);
+ Source source = addNamedSource(
+ '/a.dart',
+ r'''
+import 'b.dart';
+const v = const MyClass();
+''');
+ addNamedSource(
+ '/b.dart',
+ r'''
+class MyClass {
+ const MyClass([p = foo]);
+}
+''');
+ await computeAnalysisResult(source);
+ assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
+ }
+
test_nonConstValueInInitializer_redirecting() async {
Source source = addSource(r'''
class A {
« no previous file with comments | « pkg/analyzer/lib/src/dart/constant/evaluation.dart ('k') | pkg/analyzer/test/src/dart/constant/evaluation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698