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

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

Issue 1045553002: Implement the new '??' operator in analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix if_null_precedence_test for unchecked operation. Created 5 years, 9 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/parser_test.dart ('k') | tests/language/if_null_behavior_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/resolver_test.dart
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index 9d9a8d02cd76995a0770e08f25359081c97c9bb2..0c45439bc9831c819fb7e9e33df2a5b52477c4d1 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -365,6 +365,8 @@ class AnalysisContextForTests extends AnalysisContextImpl {
currentOptions.dart2jsHint != options.dart2jsHint ||
(currentOptions.hint && !options.hint) ||
currentOptions.preserveComments != options.preserveComments ||
+ currentOptions.enableNullAwareOperators !=
+ options.enableNullAwareOperators ||
currentOptions.enableStrictCallChecks != options.enableStrictCallChecks;
if (needsRecompute) {
fail(
@@ -9916,6 +9918,14 @@ class StaticTypeAnalyzerTest extends EngineTestCase {
_listener.assertNoErrors();
}
+ void test_visitBinaryExpression_ifNull() {
+ // 1 ?? 1.5
+ Expression node = AstFactory.binaryExpression(
+ _resolvedInteger(1), TokenType.QUESTION_QUESTION, _resolvedDouble(1.5));
+ expect(_analyze(node), same(_typeProvider.numType));
+ _listener.assertNoErrors();
+ }
+
void test_visitBinaryExpression_logicalAnd() {
// false && true
Expression node = AstFactory.binaryExpression(
« no previous file with comments | « pkg/analyzer/test/generated/parser_test.dart ('k') | tests/language/if_null_behavior_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698