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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 10332276: Remove compile-time error for unresolved factory names (issue 3079). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 | « no previous file | tests/co19/co19-runtime.status » ('j') | tests/language/language_dart2js.status » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
===================================================================
--- runtime/vm/class_finalizer.cc (revision 7819)
+++ runtime/vm/class_finalizer.cc (working copy)
@@ -821,17 +821,12 @@
const Function& function) {
// Resolve result type.
AbstractType& type = AbstractType::Handle(function.result_type());
- FinalizationKind result_finalization = kFinalize;
- if (function.IsFactory()) {
- // The name of a factory must always be resolved to a class or interface.
- // The parser sets the factory result type to a type with an unresolved
- // class whose name matches the factory name.
- result_finalization = kFinalizeWellFormed;
- // TODO(regis): Gilad asks if this compile-time error could be relaxed.
- // The result type of such a factory method would simply be malformed.
- }
- ResolveType(cls, type, result_finalization);
- type = FinalizeType(cls, type, result_finalization);
+ // In case of a factory, the parser sets the factory result type to a type
+ // with an unresolved class whose name matches the factory name.
+ // It is not a compile time error if this name does not resolve to a class or
+ // interface.
+ ResolveType(cls, type, kFinalize);
+ type = FinalizeType(cls, type, kFinalize);
// In production mode, a malformed result type is mapped to Dynamic.
if (!FLAG_enable_type_checks && type.IsMalformed()) {
type = Type::DynamicType();
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | tests/language/language_dart2js.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698