Goose  Diff

Differences From Artifact [8dbd7871cb]:

  • File bs/builtins/types/overloadset/overloadset.cpp — part of check-in [bff15eb03d] at 2019-07-11 19:32:21 on branch trunk — Allow overloading of builtin functions. (user: achavasse size: 3152)

To Artifact [80d4f816d1]:

  • File bs/sema/overloadset.cpp — part of check-in [f8f1fcd169] at 2019-07-23 19:02:40 on branch trunk — Moved overloadset's implementation into sema, as we'll need to keep pointers to some of them (used as extension points) in env. (user: achavasse size: 2226)

74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
                        co_yield { move( uniCall ), ovl, uc };
                    }
                }
            }
        }
    }
}

bool empathy::builtins::IsOverloadSet( const Value& os )
{
    return os.type() == GetValueType< ptr< OverloadSet > >();
}

namespace empathy::ir
{
    const Term& Bridge< ptr< builtins::OverloadSet > >::Type()
    {
        static auto type = ValueToIRExpr( Value( TypeType(), TSID( overloadset ) ) );
        return type;
    }

    Value Bridge< ptr< builtins::OverloadSet > >::ToValue( const ptr< builtins::OverloadSet >& os )
    {
        return Value( Type(), TERM( static_pointer_cast< void >( os ) ) );
    }

    optional< ptr< builtins::OverloadSet > > Bridge< ptr< builtins::OverloadSet > >::FromValue( const Value& v )
    {
        if( !IsOverloadSet( v ) )
            return nullopt;

        auto result = Decompose( v.val(),
            Val< ptr< void > >()
        );

        if( !result )
            return nullopt;

        return static_pointer_cast< builtins::OverloadSet >( result->get() );
    }
}







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
74
75
76
77
78
79
80


































                        co_yield { move( uniCall ), ovl, uc };
                    }
                }
            }
        }
    }
}