File tree Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Expand file tree Collapse file tree 3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -148,11 +148,13 @@ TyTyResolveCompile::visit (const TyTy::FnPtr &type)
148
148
tree result_type = TyTyResolveCompile::compile (ctx, type.get_return_type ());
149
149
150
150
std::vector<tree> parameters;
151
- type.iterate_params ([&] (TyTy::BaseType *p) mutable -> bool {
152
- tree pty = TyTyResolveCompile::compile (ctx, p);
153
- parameters.push_back (pty);
154
- return true ;
155
- });
151
+
152
+ auto ¶ms = type.get_params ();
153
+ for (auto &p : params)
154
+ {
155
+ tree pty = TyTyResolveCompile::compile (ctx, p.get_tyty ());
156
+ parameters.push_back (pty);
157
+ }
156
158
157
159
translated = ctx->get_backend ()->function_ptr_type (result_type, parameters,
158
160
type.get_ident ().locus );
Original file line number Diff line number Diff line change @@ -1294,10 +1294,13 @@ std::string
1294
1294
FnPtr::as_string () const
1295
1295
{
1296
1296
std::string params_str;
1297
- iterate_params ([&] (BaseType *p) mutable -> bool {
1298
- params_str += p->as_string () + " ," ;
1299
- return true ;
1300
- });
1297
+
1298
+ auto ¶ms = get_params ();
1299
+ for (auto &p : params)
1300
+ {
1301
+ params_str += p.get_tyty ()->as_string () + " ," ;
1302
+ }
1303
+
1301
1304
return " fnptr (" + params_str + " ) -> " + get_return_type ()->as_string ();
1302
1305
}
1303
1306
Original file line number Diff line number Diff line change @@ -1526,6 +1526,9 @@ class FnPtr : public BaseType
1526
1526
}
1527
1527
}
1528
1528
1529
+ std::vector<TyVar> &get_params () { return params; }
1530
+ const std::vector<TyVar> &get_params () const { return params; }
1531
+
1529
1532
bool is_concrete () const override final
1530
1533
{
1531
1534
for (auto &p : params)
You can’t perform that action at this time.
0 commit comments