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

Unified Diff: tests/compiler/dart2js/cpa_inference_test.dart

Issue 12086083: Handle is checks (in a naive way: no narrowing for now). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: sync to head Created 7 years, 11 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 | « sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/cpa_inference_test.dart
diff --git a/tests/compiler/dart2js/cpa_inference_test.dart b/tests/compiler/dart2js/cpa_inference_test.dart
index ae905932a7237ccafc2750dfc47561f51a930cfb..2e8e52942e18c06224d4844230162db43b84f26c 100644
--- a/tests/compiler/dart2js/cpa_inference_test.dart
+++ b/tests/compiler/dart2js/cpa_inference_test.dart
@@ -1023,6 +1023,17 @@ testDynamicIsAbsorbing() {
result.checkNodeHasUnknownType('x');
}
+testIsCheck() {
+ final String source = r"""
+ main () {
+ var x = (1 is String);
+ x;
+ }
+ """;
+ AnalysisResult result = analyze(source);
+ result.checkNodeHasType('x', [result.bool]);
+}
+
void main() {
testDynamicBackDoor();
testLiterals();
@@ -1063,4 +1074,5 @@ void main() {
testLists();
testListWithCapacity();
testEmptyList();
+ testIsCheck();
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698