mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
A patch class must be given the same name as the class it is patching, otherwise
the generic signature classes it defines will not match the patched generic signature classes. Therefore, new signature classes will be introduced and the original ones will not get finalized. Review URL: https://codereview.chromium.org//14097006 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21235 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
2c5cea8d4e
commit
5900ae72af
2 changed files with 5 additions and 5 deletions
|
@ -3240,10 +3240,11 @@ void Parser::ParseClassDefinition(const GrowableObjectArray& pending_classes) {
|
|||
// Preserve and reuse the original type parameters and bounds since the
|
||||
// ones defined in the patch class will not be finalized.
|
||||
orig_type_parameters = cls.type_parameters();
|
||||
String& patch = String::Handle(
|
||||
String::Concat(Symbols::PatchSpace(), class_name));
|
||||
patch = Symbols::New(patch);
|
||||
cls = Class::New(patch, script_, classname_pos);
|
||||
// A patch class must be given the same name as the class it is patching,
|
||||
// otherwise the generic signature classes it defines will not match the
|
||||
// patched generic signature classes. Therefore, new signature classes
|
||||
// will be introduced and the original ones will not get finalized.
|
||||
cls = Class::New(class_name, script_, classname_pos);
|
||||
cls.set_library(library_);
|
||||
} else {
|
||||
// Not patching a class, but it has been found. This must be one of the
|
||||
|
|
|
@ -221,7 +221,6 @@ class ObjectPointerVisitor;
|
|||
V(ColonSpace, ": ") \
|
||||
V(RParenArrow, ") => ") \
|
||||
V(SpaceExtendsSpace, " extends ") \
|
||||
V(PatchSpace, "patch ") \
|
||||
V(SwitchExpr, ":switch_expr") \
|
||||
V(TwoNewlines, "\n\n") \
|
||||
V(TwoSpaces, " ") \
|
||||
|
|
Loading…
Reference in a new issue