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

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

Issue 2215873002: fix #26512, correct handling of fuzzy arrows in strong mode LUB (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rebase & fix pass through of arg 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/test/generated/type_system_test.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/checker_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
index 8bdd4ce38ac9f40e19f724610d096de008f93c69..0025383253f9b2f3e9af3aca78194f89111c3948 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -2612,6 +2612,20 @@ class C {
''');
}
+ void test_leastUpperBounds_fuzzyArrows() {
+ checkFile(r'''
+typedef String TakesA<T>(T item);
+
+void main() {
+ TakesA<int> f;
+ TakesA<dynamic> g;
+ TakesA<String> h;
+ g = h;
+ f = /*warning:DOWN_CAST_COMPOSITE*/f ?? g;
+}
+''');
+ }
+
void test_loadLibrary() {
addFile('''library lib1;''', name: '/lib1.dart');
checkFile(r'''
@@ -3322,7 +3336,9 @@ class SplayTreeMap<K, V> {
bool isValidKey(potentialKey)])
: _comparator = /*warning:DOWN_CAST_COMPOSITE*/(compare == null) ? Comparable.compare : compare,
_validKey = (isValidKey != null) ? isValidKey : ((v) => true) {
- _Predicate<Object> v = (isValidKey != null)
+
+ // NOTE: this is a down cast because isValidKey has fuzzy arrow type.
+ _Predicate<Object> v = /*warning:DOWN_CAST_COMPOSITE*/(isValidKey != null)
? isValidKey : (/*info:INFERRED_TYPE_CLOSURE*/(_) => true);
v = (isValidKey != null)
« no previous file with comments | « pkg/analyzer/test/generated/type_system_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698