Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dyno: Generate function bodies for init=, deinit, and (de)serializers #26322

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
11 changes: 11 additions & 0 deletions frontend/lib/resolution/Resolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2704,6 +2704,17 @@ QualifiedType Resolver::typeForId(const ID& id, bool localGenericToUnknown) {
}
}

if (auto tup = rt->toTupleType()) {
auto field = parsing::idToAst(context, id)->toNamedDecl();
if (field && field->name() == USTR("size")) {
// Tuples don't store a 'size' in their substitutions map, so
// manually take care of things here.
auto intType = IntType::get(context, 0);
auto val = IntParam::get(context, tup->numElements());
return QualifiedType(QualifiedType::PARAM, intType, val);
}
}

if (auto comprt = rt->getCompositeType()) {
if (comprt->id() == parentId) {
ct = comprt; // handle record, class with field
Expand Down
Loading