19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
switch( env.retrieveValue( identity, RootG0Identity(), result ) )
{
case sema::Env::Status::Success:
return *FromValue< ptr< OverloadSet > >( *EIRToValue( result ) );
case sema::Env::Status::NoMatch:
G_ERROR( format( "fatal: overload set {} not found", name ) );
case sema::Env::Status::AmbiguousMatch:
G_ERROR( format( "fatal: ambiguous match for overload set {}", name ) );
}
return nullptr;
}
ptr< OverloadSet > GetOrCreateOverloadSet( Env& env, StringId name )
{
|
|
|
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
switch( env.retrieveValue( identity, RootG0Identity(), result ) )
{
case sema::Env::Status::Success:
return *FromValue< ptr< OverloadSet > >( *EIRToValue( result ) );
case sema::Env::Status::NoMatch:
G_ERROR( format( "fatal: overload set {} not found", name.str() ) );
case sema::Env::Status::AmbiguousMatch:
G_ERROR( format( "fatal: ambiguous match for overload set {}", name.str() ) );
}
return nullptr;
}
ptr< OverloadSet > GetOrCreateOverloadSet( Env& env, StringId name )
{
|
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
{
auto pOvlSet = make_shared< OverloadSet >( identity );
env.storeValue( identity, ANYTERM( _ ), ValueToEIR( ToValue( pOvlSet ) ) );
return pOvlSet;
}
case sema::Env::Status::AmbiguousMatch:
G_ERROR( format( "fatal: ambiguous match for overload set {}", name ) );
}
return nullptr;
}
Value InvokeOverloadSet( const Context& c, const ptr< OverloadSet >& pOvlSet, Value args )
{
|
|
|
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
{
auto pOvlSet = make_shared< OverloadSet >( identity );
env.storeValue( identity, ANYTERM( _ ), ValueToEIR( ToValue( pOvlSet ) ) );
return pOvlSet;
}
case sema::Env::Status::AmbiguousMatch:
G_ERROR( format( "fatal: ambiguous match for overload set {}", name.str() ) );
}
return nullptr;
}
Value InvokeOverloadSet( const Context& c, const ptr< OverloadSet >& pOvlSet, Value args )
{
|