Goose  Diff

Differences From Artifact [dd1ae1afe5]:

  • File bs/builtins/types/template/build.cpp — part of check-in [fc331f1703] at 2019-04-06 14:16:09 on branch trunk —
    • Simplified TDecl: the right hand side can now only be a TVar. Removed the colon operator.
    • Added the possibility in unification to make hole resolution non mandatory for a sub expression.
    • Higher order polymorphism: implemented the unification of a polymorphic tfunc type param with a template lambda.
    (user: achavasse size: 3333)

To Artifact [1ef524f33e]:

  • File bs/builtins/types/template/build.cpp — part of check-in [da8245add8] at 2019-04-09 20:15:04 on branch trunk — Standardize the way function identities are generated, and give overload sets their own identities. This will be necessary to generate proper identities for template functions instanced with polymorphic parameters. (user: achavasse size: 3260)

55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
            return nullopt;
        }

        return TVEC( TERM( make_shared< Vector >( vt.persistent(), false ) ),
            *rtSig );
    }

    optional< Value > BuildTFunc( const Context& c, const StringId& id, const Value& returnType, const Value& params, vector< Term >&& body )
    {
        auto funcType = BuildTFuncType( returnType, params );

        auto sig = BuildTFuncSignature( c, funcType );
        if( !sig )
            return nullopt;

        auto pToks = make_shared< vector< Term > >( move( body ) );

        return ToValue( TFunc( move( funcType ),
            *sig,
            AppendToVectorTerm( c.identity(), TERM( id ) ),
            move( pToks ) ) );
    }

    optional< Term > BuildArgPatternFromTFuncType( const Context& c, const Value& tfuncType )
    {
        const auto& ftype = FromValue< TFuncType >( tfuncType );
        assert( ftype );








|








<
|
<
<
<







55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

71



72
73
74
75
76
77
78
            return nullopt;
        }

        return TVEC( TERM( make_shared< Vector >( vt.persistent(), false ) ),
            *rtSig );
    }

    optional< Value > BuildTFunc( const Context& c, const Term& identity, const Value& returnType, const Value& params, vector< Term >&& body )
    {
        auto funcType = BuildTFuncType( returnType, params );

        auto sig = BuildTFuncSignature( c, funcType );
        if( !sig )
            return nullopt;

        auto pToks = make_shared< vector< Term > >( move( body ) );

        return ToValue( TFunc( move( funcType ), *sig, identity, move( pToks ) ) );



    }

    optional< Term > BuildArgPatternFromTFuncType( const Context& c, const Value& tfuncType )
    {
        const auto& ftype = FromValue< TFuncType >( tfuncType );
        assert( ftype );