mirror of
https://github.com/dart-lang/sdk
synced 2024-10-04 03:22:52 +00:00
Review URL: http://codereview.chromium.org//8384018 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1036 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
74866724b7
commit
ec78d3fce6
|
@ -870,7 +870,7 @@ public class DartParser extends CompletionHooksParserBase {
|
|||
modifiers = modifiers.makeNative();
|
||||
function = new DartFunction(formals, parseNativeBlock(modifiers), null);
|
||||
} else {
|
||||
function = new DartFunction(formals, parseBlock(), null);
|
||||
function = new DartFunction(formals, parseFunctionStatementBody(true), null);
|
||||
}
|
||||
doneWithoutConsuming(function);
|
||||
return DartMethodDefinition.create(name, function, modifiers, null, typeParameters);
|
||||
|
|
|
@ -113,6 +113,7 @@ public class MemberBuilder {
|
|||
case NONE:
|
||||
case CONSTRUCTOR:
|
||||
element = buildConstructor(method);
|
||||
checkConstructor(element, method);
|
||||
addConstructor((ClassElement) currentHolder, (ConstructorElement) element);
|
||||
break;
|
||||
|
||||
|
@ -429,6 +430,13 @@ public class MemberBuilder {
|
|||
// example const and missing body.
|
||||
}
|
||||
|
||||
private void checkConstructor(MethodElement element, DartMethodDefinition method) {
|
||||
if (Elements.isNonFactoryConstructor(element) && method.getFunction() != null
|
||||
&& method.getFunction().getReturnTypeNode() != null) {
|
||||
resolutionError(method, ResolverErrorCode.CONSTRUCTOR_CANNOT_HAVE_RETURN_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
private void checkUniqueName(EnclosingElement holder, Element e) {
|
||||
Element other = lookupElementByName(holder, e.getName(), e.getModifiers());
|
||||
assert e != other : "forgot to call checkUniqueName() before adding to the class?";
|
||||
|
|
|
@ -33,6 +33,7 @@ public enum ResolverErrorCode implements ErrorCode {
|
|||
"super type %s does not have a default constructor"),
|
||||
CONSTRUCTOR_CANNOT_BE_ABSTRACT("A constructor cannot be asbstract"),
|
||||
CONSTRUCTOR_CANNOT_BE_STATIC("A constructor cannot be static"),
|
||||
CONSTRUCTOR_CANNOT_HAVE_RETURN_TYPE("Generative constructors cannot have return type"),
|
||||
CONST_CONSTRUCTOR_CANNOT_HAVE_BODY("A const constructor cannot have a body"),
|
||||
CONST_CONSTRUCTOR_MUST_CALL_CONST_SUPER("const constructor must call const super constructor"),
|
||||
CONSTANTS_MUST_BE_INITIALIZED("constants must be initialized"),
|
||||
|
|
|
@ -34,17 +34,14 @@ LangGuideTest/02_Language_Constructs/02_11_Exceptions/A09/t02: Fail # Issue 219
|
|||
|
||||
LangGuideTest/02_Language_Constructs/02_1_Class/02_1_Class_Const_Expressions/A04/t01: Fail # Bug 5371670.
|
||||
LangGuideTest/02_Language_Constructs/02_1_Class/02_1_Class_Const_Expressions/A02/t01: Fail # Bug 5371670.
|
||||
LangGuideTest/02_Language_Constructs/02_1_Class/02_1_Class_Construction/A02/t02: Fail # Bug 5371670.
|
||||
LangGuideTest/02_Language_Constructs/02_1_Class/02_1_Class_Construction/A02/t03: Fail # Bug 5371670.
|
||||
LangGuideTest/02_Language_Constructs/02_1_Class/02_1_Class_Construction/A02/t04: Fail # Bug 5371670.
|
||||
LangGuideTest/02_Language_Constructs/02_1_Class/02_1_Class_Construction/A03/t01: Fail # Bug 5371670.
|
||||
LangGuideTest/02_Language_Constructs/02_1_Class/02_1_Class_Construction/A06/t04: Fail # Bug 5371670.
|
||||
LangGuideTest/02_Language_Constructs/02_1_Class/02_1_Class_Construction/A10/t01: Fail # Bug 5371670.
|
||||
LangGuideTest/02_Language_Constructs/02_1_Class/02_1_Class_Construction/A13/t01: Fail # Bug 5371670.
|
||||
LangGuideTest/02_Language_Constructs/02_1_Class/02_1_Class_Construction/A18/t01: Fail # Bug 5371670.
|
||||
LangGuideTest/02_Language_Constructs/02_2_Interface/A02/t03: Fail # Bug 5371670.
|
||||
|
||||
LangGuideTest/02_Language_Constructs/02_7_Abstract_Methods/A02/t01: Fail # Bug 5371670.
|
||||
|
||||
LangGuideTest/07_Overriding/A02/t01: Fail # Bug 5371670.
|
||||
LangGuideTest/07_Overriding/A02/t02: Fail # Bug 5371670.
|
||||
LangGuideTest/07_Overriding/A05/t01: Fail # Bug 5371670.
|
||||
|
@ -177,7 +174,6 @@ LibTest/core/List/List.fromList/*: Fail
|
|||
|
||||
# New problems on 2011-11-01.
|
||||
[ $component == dartc ]
|
||||
LangGuideTest/02_Language_Constructs/02_1_Class/02_1_Class_Construction/A02/t01: Fail
|
||||
LangSpecTest/13_Types/13_1_Static_Types/A04/t01: Fail
|
||||
LangSpecTest/13_Types/13_2_Dynamic_Type_System/A01/t01: Fail
|
||||
LangSpecTest/13_Types/13_2_Dynamic_Type_System/A01/t02: Fail
|
||||
|
|
|
@ -158,8 +158,6 @@ BlackListedTest/10: Fail # Bug 5469684
|
|||
BlackListedTest/11: Fail # Bug 5469684
|
||||
BlackListedTest/12: Fail # Bug 5469684
|
||||
|
||||
FactoryArrowTest: Fail # Issue 223
|
||||
|
||||
# VM specific tests that should not be run by DartC.
|
||||
*VMTest: Skip
|
||||
|
||||
|
|
Loading…
Reference in a new issue