| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package com.google.dart.compiler.resolver; | 5 package com.google.dart.compiler.resolver; |
| 6 | 6 |
| 7 import com.google.common.base.Joiner; | 7 import com.google.common.base.Joiner; |
| 8 import com.google.dart.compiler.DartCompilationError; | 8 import com.google.dart.compiler.DartCompilationError; |
| 9 import com.google.dart.compiler.ErrorCode; | 9 import com.google.dart.compiler.ErrorCode; |
| 10 import com.google.dart.compiler.ast.DartClass; | 10 import com.google.dart.compiler.ast.DartClass; |
| (...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1621 | 1621 |
| 1622 public void test_invokeTypeAlias() throws Exception { | 1622 public void test_invokeTypeAlias() throws Exception { |
| 1623 resolveAndTest(Joiner.on("\n").join( | 1623 resolveAndTest(Joiner.on("\n").join( |
| 1624 "class Object {}", | 1624 "class Object {}", |
| 1625 "typedef Object func();", | 1625 "typedef Object func();", |
| 1626 "method() {", | 1626 "method() {", |
| 1627 " func();", | 1627 " func();", |
| 1628 "}"), | 1628 "}"), |
| 1629 errEx(ResolverErrorCode.CANNOT_CALL_FUNCTION_TYPE_ALIAS, 4, 3, 6)); | 1629 errEx(ResolverErrorCode.CANNOT_CALL_FUNCTION_TYPE_ALIAS, 4, 3, 6)); |
| 1630 } | 1630 } |
| 1631 |
| 1632 public void test_defaultTargetInterface() throws Exception { |
| 1633 resolveAndTest(Joiner.on("\n").join( |
| 1634 "class Object {}", |
| 1635 "interface A default B {", |
| 1636 " A();", |
| 1637 "}", |
| 1638 "interface B {", |
| 1639 "}"), |
| 1640 errEx(ResolverErrorCode.DEFAULT_MUST_SPECIFY_CLASS, 2, 21, 1), |
| 1641 errEx(ResolverErrorCode.DEFAULT_CONSTRUCTOR_UNRESOLVED, 3, 3, 4)); |
| 1642 } |
| 1643 |
| 1644 public void test_initializerErrors() { |
| 1645 resolveAndTest(Joiner.on("\n").join( |
| 1646 "class Object {}", |
| 1647 "class A { }", |
| 1648 "class B<T> {", |
| 1649 " method() { }", |
| 1650 " B(arg) : A = 1, ", |
| 1651 " method = 2,", |
| 1652 " arg = 3,", |
| 1653 " T = 4 {}", |
| 1654 "}"), |
| 1655 errEx(ResolverErrorCode.EXPECTED_FIELD_NOT_CLASS, 5, 12, 1), |
| 1656 errEx(ResolverErrorCode.EXPECTED_FIELD_NOT_METHOD, 6, 12, 6), |
| 1657 errEx(ResolverErrorCode.EXPECTED_FIELD_NOT_PARAMETER, 7, 12, 3), |
| 1658 errEx(ResolverErrorCode.EXPECTED_FIELD_NOT_TYPE_VAR, 8, 12, 1)); |
| 1659 } |
| 1631 } | 1660 } |
| OLD | NEW |