Skip to content

Commit

Permalink
Use kFunctionCid instead of kIllegalCid to indicate that a generic fu…
Browse files Browse the repository at this point in the history
…nction

type parameter does not parameterize a class, but a function.
Snapshot generation apparently trips on kIllegalCid.

R=johnmccutchan@google.com, rmacnak@google.com

Review-Url: https://codereview.chromium.org/2567163002 .
  • Loading branch information
crelier committed Dec 12, 2016
1 parent b62c5e4 commit 53e93e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions runtime/vm/object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17610,7 +17610,7 @@ bool TypeParameter::IsEquivalent(const Instance& other, TrailPtr trail) const {

void TypeParameter::set_parameterized_class(const Class& value) const {
// Set value may be null.
classid_t cid = kIllegalCid;
classid_t cid = kFunctionCid; // Denotes a function type parameter.
if (!value.IsNull()) {
cid = value.id();
}
Expand All @@ -17625,7 +17625,7 @@ classid_t TypeParameter::parameterized_class_id() const {

RawClass* TypeParameter::parameterized_class() const {
classid_t cid = parameterized_class_id();
if (cid == kIllegalCid) {
if (cid == kFunctionCid) {
return Class::null();
}
return Isolate::Current()->class_table()->At(cid);
Expand Down
2 changes: 1 addition & 1 deletion runtime/vm/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -6057,7 +6057,7 @@ class TypeParameter : public AbstractType {
return raw_ptr()->parameterized_function_;
}
bool IsClassTypeParameter() const {
return parameterized_class_id() != kIllegalCid;
return parameterized_class_id() != kFunctionCid;
}
bool IsFunctionTypeParameter() const {
return parameterized_function() != Function::null();
Expand Down

0 comments on commit 53e93e8

Please sign in to comment.