Changeset be4335b
- Timestamp:
- Feb 2, 2024, 6:31:52 PM (11 months ago)
- Branches:
- master
- Children:
- 47bd204
- Parents:
- bd67442
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cpp
rbd67442 rbe4335b 25 25 #include "AST/GenericSubstitution.hpp" // for genericSubstitution 26 26 #include "CodeGen/OperatorTable.h" // for isAssignment 27 #include "Common/Iterate.hpp" // for group_iterate 27 28 #include "Common/ScopedMap.h" // for ScopedMap 29 #include "Common/ToString.hpp" // for toCString 28 30 #include "Common/UniqueName.h" // for UniqueName 29 #include "Common/utility.h" // for toCString, group_iterate30 31 #include "GenPoly/FindFunction.h" // for findFunction 31 32 #include "GenPoly/GenPoly.h" // for getFunctionType, ... … … 236 237 ) ); 237 238 // TODO: Polymorphic types will be out of the struct declaration scope. 238 // Should be removed by PolyGenericCalculator.239 // This breaks invariants until it is corrected later. 239 240 for ( auto const & member : enumerate( decl->members ) ) { 240 241 auto dwt = member.val.strict_as<ast::DeclWithType>(); … … 309 310 ) ); 310 311 // TODO: Polymorphic types will be out of the union declaration scope. 312 // This breaks invariants until it is corrected later. 311 313 for ( auto const & member : decl->members ) { 312 314 auto dwt = member.strict_as<ast::DeclWithType>(); … … 575 577 if ( adapters.contains( mangleName ) ) continue; 576 578 std::string adapterName = makeAdapterName( mangleName ); 577 // TODO: The forwarding here is problematic because these578 // declarations are not rooted anywhere in the translation unit.579 // NODE: This creates floating nodes, breaking invariants. 580 // This is corrected in the RewireAdapters sub-pass. 579 581 adapters.insert( 580 582 mangleName, … … 639 641 640 642 TypeVarMap exprTypeVars; 641 // TODO: Should this take into account the variables already bound in642 // scopeTypeVars ([ex] remove them from exprTypeVars)?643 643 makeTypeVarMap( function, exprTypeVars ); 644 644 auto dynRetType = isDynRet( function, exprTypeVars ); … … 1521 1521 1522 1522 // -------------------------------------------------------------------------- 1523 // TODO: Ideally, there would be no floating nodes at all.1524 1523 /// Corrects the floating nodes created in CallAdapter. 1525 1524 struct RewireAdapters final : public ast::WithGuards { … … 1837 1836 1838 1837 // Not all members of a polymorphic type are themselves of a polymorphic 1839 // type; in this cas the member expression should be wrapped and1838 // type; in this case the member expression should be wrapped and 1840 1839 // dereferenced to form an lvalue. 1841 1840 if ( !isPolyType( memberType, scopeTypeVars ) ) {
Note: See TracChangeset
for help on using the changeset viewer.