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

Unified Diff: pkg/analyzer/test/src/task/strong/inferred_type_test.dart

Issue 2207473004: fixes #26993, constant evaluation gets wrong type (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rebase and sort Created 4 years, 4 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/generated/static_type_analyzer.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/inferred_type_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index 5a4793497dda2646071693ff8527928b827ca7b3..741659a2822bad3484d6af9030708eb1b282277d 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -651,6 +651,23 @@ var x = /*info:INFERRED_TYPE_ALLOCATION*/const C(42);
expect(unit.topLevelVariables[0].type.toString(), 'C<int>');
}
+ void test_constructors_inferFromArguments_constWithUpperBound() {
+ // Regression for https://github.com/dart-lang/sdk/issues/26993
+ checkFile('''
+class C<T extends num> {
+ final T x;
+ const C(this.x);
+}
+class D<T extends num> {
+ const D();
+}
+void f() {
+ const c = /*info:INFERRED_TYPE_ALLOCATION*/const C(0);
+ const D<int> d = /*info:INFERRED_TYPE_ALLOCATION*/const D();
+}
+ ''');
+ }
+
void test_constructors_inferFromArguments_factory() {
var unit = checkFile('''
class C<T> {
« no previous file with comments | « pkg/analyzer/lib/src/generated/static_type_analyzer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698