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

Side by Side Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java

Issue 47513022: Issue 14363. Support for type promotion when '(v) is T'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, the Dart project authors. 2 * Copyright (c) 2013, the Dart project authors.
3 * 3 *
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except
5 * in compliance with the License. You may obtain a copy of the License at 5 * in compliance with the License. You may obtain a copy of the License at
6 * 6 *
7 * http://www.eclipse.org/legal/epl-v10.html 7 * http://www.eclipse.org/legal/epl-v10.html
8 * 8 *
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express
(...skipping 3306 matching lines...) Expand 10 before | Expand all | Expand 10 after
3317 "main(Object p) {", 3317 "main(Object p) {",
3318 " if (p is String) {", 3318 " if (p is String) {",
3319 " p.length;", 3319 " p.length;",
3320 " }", 3320 " }",
3321 "}")); 3321 "}"));
3322 resolve(source); 3322 resolve(source);
3323 assertNoErrors(source); 3323 assertNoErrors(source);
3324 verify(source); 3324 verify(source);
3325 } 3325 }
3326 3326
3327 public void test_typePromotion_parentheses() throws Exception {
3328 Source source = addSource(createSource(//
3329 "main(Object p) {",
3330 " (p is String) ? p.length : 0;",
3331 " (p) is String ? p.length : 0;",
3332 " ((p)) is String ? p.length : 0;",
3333 " ((p) is String) ? p.length : 0;",
3334 "}"));
3335 resolve(source);
3336 assertNoErrors(source);
3337 verify(source);
3338 }
3339
3327 public void test_typeType_class() throws Exception { 3340 public void test_typeType_class() throws Exception {
3328 Source source = addSource(createSource(// 3341 Source source = addSource(createSource(//
3329 "class C {}", 3342 "class C {}",
3330 "f(Type t) {}", 3343 "f(Type t) {}",
3331 "main() {", 3344 "main() {",
3332 " f(C);", 3345 " f(C);",
3333 "}")); 3346 "}"));
3334 resolve(source); 3347 resolve(source);
3335 assertNoErrors(source); 3348 assertNoErrors(source);
3336 verify(source); 3349 verify(source);
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
3647 resolve(source); 3660 resolve(source);
3648 assertNoErrors(source); 3661 assertNoErrors(source);
3649 verify(source); 3662 verify(source);
3650 reset(); 3663 reset();
3651 } 3664 }
3652 3665
3653 private void check_wrongNumberOfParametersForOperator1(String name) throws Exc eption { 3666 private void check_wrongNumberOfParametersForOperator1(String name) throws Exc eption {
3654 check_wrongNumberOfParametersForOperator(name, "a"); 3667 check_wrongNumberOfParametersForOperator(name, "a");
3655 } 3668 }
3656 } 3669 }
OLDNEW
« no previous file with comments | « editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698