1
2
3
4
5
6
7
8
9
|
#include "builtins/builtins.h"
using namespace goose::sema;
bool OverloadSet::add( const Env& e, const Value& callee )
{
auto pInvRule = GetInvocationRule( e, callee );
assert( pInvRule );
return add( e, callee, pInvRule );
|
>
|
1
2
3
4
5
6
7
8
9
10
|
#include "builtins/builtins.h"
using namespace goose;
using namespace goose::sema;
bool OverloadSet::add( const Env& e, const Value& callee )
{
auto pInvRule = GetInvocationRule( e, callee );
assert( pInvRule );
return add( e, callee, pInvRule );
|
44
45
46
47
48
49
50
|
for( auto&& [callVec,uniCallVec,ovl,tcc] : m_trie->typeCheck( *callDecomp->get(), tcc ) )
{
auto uniCall = TERM( make_shared< Vector >( uniCallVec ) );
co_yield { move( uniCall ), ovl, tcc };
}
}
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
for( auto&& [callVec,uniCallVec,ovl,tcc] : m_trie->typeCheck( *callDecomp->get(), tcc ) )
{
auto uniCall = TERM( make_shared< Vector >( uniCallVec ) );
co_yield { move( uniCall ), ovl, tcc };
}
}
optional< OverloadSet::Overload > OverloadSet::getResolutionFromCache( const Term& args ) const
{
ProfileZoneScoped;
for( auto&& [_,ovl] : Match( args, m_resolutionCache ) )
return ovl;
return nullopt;
}
void OverloadSet::addResolutionToCache( const Term& args, const Overload& ovl )
{
ProfileZoneScoped;
m_resolutionCache = Merge( m_resolutionCache, args,
[&]( auto&& ) { return ovl; } );
}
|