OLD | NEW |
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 "class B {}")); | 63 "class B {}")); |
64 addSource("/lib2.dart", createSource(// | 64 addSource("/lib2.dart", createSource(// |
65 "library L2;", | 65 "library L2;", |
66 "class B {}", | 66 "class B {}", |
67 "class C {}")); | 67 "class C {}")); |
68 resolve(source); | 68 resolve(source); |
69 assertNoErrors(source); | 69 assertNoErrors(source); |
70 verify(source); | 70 verify(source); |
71 } | 71 } |
72 | 72 |
| 73 public void test_ambiguousExport_sameDeclaration() throws Exception { |
| 74 Source source = addSource(createSource(// |
| 75 "library L;", |
| 76 "export 'lib.dart';", |
| 77 "export 'lib.dart';")); |
| 78 addSource("/lib.dart", createSource(// |
| 79 "library lib;", |
| 80 "class N {}")); |
| 81 resolve(source); |
| 82 assertNoErrors(source); |
| 83 verify(source); |
| 84 } |
| 85 |
73 public void test_argumentDefinitionTestNonParameter_formalParameter() throws E
xception { | 86 public void test_argumentDefinitionTestNonParameter_formalParameter() throws E
xception { |
74 Source source = addSource(createSource(// | 87 Source source = addSource(createSource(// |
75 "f(var v) {", | 88 "f(var v) {", |
76 " return ?v;", | 89 " return ?v;", |
77 "}")); | 90 "}")); |
78 resolve(source); | 91 resolve(source); |
79 assertErrors(source, ParserErrorCode.DEPRECATED_ARGUMENT_DEFINITION_TEST); | 92 assertErrors(source, ParserErrorCode.DEPRECATED_ARGUMENT_DEFINITION_TEST); |
80 verify(source); | 93 verify(source); |
81 } | 94 } |
82 | 95 |
(...skipping 3011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3094 Source source = addSource(createSource(// | 3107 Source source = addSource(createSource(// |
3095 "callMe(f()) { f(); }", | 3108 "callMe(f()) { f(); }", |
3096 "main(Object p) {", | 3109 "main(Object p) {", |
3097 " (p is String) && callMe(() { p.length; });", | 3110 " (p is String) && callMe(() { p.length; });", |
3098 "}")); | 3111 "}")); |
3099 resolve(source); | 3112 resolve(source); |
3100 assertNoErrors(source); | 3113 assertNoErrors(source); |
3101 verify(source); | 3114 verify(source); |
3102 } | 3115 } |
3103 | 3116 |
| 3117 public void test_typePromotion_conditional_issue14655() throws Exception { |
| 3118 Source source = addSource(createSource(// |
| 3119 "class A {}", |
| 3120 "class B extends A {}", |
| 3121 "class C extends B {", |
| 3122 " mc() {}", |
| 3123 "}", |
| 3124 "print(_) {}", |
| 3125 "main(A p) {", |
| 3126 " (p is C) && (print(() => p) && (p is B)) ? p.mc() : p = null;", |
| 3127 "}")); |
| 3128 resolve(source); |
| 3129 assertNoErrors(source); |
| 3130 verify(source); |
| 3131 } |
| 3132 |
3104 public void test_typePromotion_conditional_useInThen() throws Exception { | 3133 public void test_typePromotion_conditional_useInThen() throws Exception { |
3105 Source source = addSource(createSource(// | 3134 Source source = addSource(createSource(// |
3106 "main(Object p) {", | 3135 "main(Object p) {", |
3107 " p is String ? p.length : 0;", | 3136 " p is String ? p.length : 0;", |
3108 "}")); | 3137 "}")); |
3109 resolve(source); | 3138 resolve(source); |
3110 assertNoErrors(source); | 3139 assertNoErrors(source); |
3111 verify(source); | 3140 verify(source); |
3112 } | 3141 } |
3113 | 3142 |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3668 resolve(source); | 3697 resolve(source); |
3669 assertNoErrors(source); | 3698 assertNoErrors(source); |
3670 verify(source); | 3699 verify(source); |
3671 reset(); | 3700 reset(); |
3672 } | 3701 } |
3673 | 3702 |
3674 private void check_wrongNumberOfParametersForOperator1(String name) throws Exc
eption { | 3703 private void check_wrongNumberOfParametersForOperator1(String name) throws Exc
eption { |
3675 check_wrongNumberOfParametersForOperator(name, "a"); | 3704 check_wrongNumberOfParametersForOperator(name, "a"); |
3676 } | 3705 } |
3677 } | 3706 } |
OLD | NEW |