Ignore:
Timestamp:
Jun 12, 2023, 2:45:32 PM (14 months ago)
Author:
Fangren Yu <f37yu@…>
Branches:
ast-experimental, master
Children:
62d62db
Parents:
34b4268 (diff), 251ce80 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ast-experimental

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/SatisfyAssertions.cpp

    r34b4268 r24d6572  
    2424#include <vector>
    2525
     26#include "AdjustExprType.hpp"
    2627#include "Candidate.hpp"
    2728#include "CandidateFinder.hpp"
     29#include "CommonType.hpp"
    2830#include "Cost.h"
    2931#include "RenameVars.h"
     32#include "SpecCost.hpp"
    3033#include "typeops.h"
    3134#include "Unify.h"
     
    181184                                .strict_as<ast::FunctionType>()->params[0]
    182185                                .strict_as<ast::ReferenceType>()->base;
    183                         sat.cand->env.apply(thisArgType);
     186                        // sat.cand->env.apply(thisArgType);
     187
     188                        if (auto inst = thisArgType.as<ast::TypeInstType>()) {
     189                                auto cls = sat.cand->env.lookup(*inst);
     190                                if (cls && cls->bound) thisArgType = cls->bound;
     191                        }
    184192
    185193                        std::string otypeKey = "";
     
    218226                        ast::TypeEnvironment tempNewEnv {newEnv};
    219227
    220                         if ( unifyExact( toType, adjType, tempNewEnv, newNeed, have, newOpen, WidenMode {true, true}, sat.symtab ) ) {
     228                        if ( unifyExact( toType, adjType, tempNewEnv, newNeed, have, newOpen, WidenMode {true, true} ) ) {
    221229                                // set up binding slot for recursive assertions
    222230                                ast::UniqueId crntResnSlot = 0;
     
    234242                                // newEnv = sat.cand->env;
    235243                                // newNeed.clear();
    236                                 if ( auto c = commonType( toType, adjType, newEnv, newNeed, have, newOpen, WidenMode {true, true}, sat.symtab ) ) {
     244                                if ( auto c = commonType( toType, adjType, newEnv, newNeed, have, newOpen, WidenMode {true, true} ) ) {
    237245                                        // set up binding slot for recursive assertions
    238246                                        ast::UniqueId crntResnSlot = 0;
     
    398406                        mergeOpenVars( open, i.match.open );
    399407
    400                         if ( ! env.combine( i.match.env, open, symtab ) ) return false;
     408                        if ( ! env.combine( i.match.env, open ) ) return false;
    401409
    402410                        crnt.emplace_back( i );
Note: See TracChangeset for help on using the changeset viewer.