Goose  Diff

Differences From Artifact [949a7c2d6f]:

  • File bs/builtins/types/overloadset/helpers.cpp — part of check-in [4d4d76607a] at 2023-03-05 22:24:05 on branch trunk —
    • removed fmtlib, now use std::format
    • vastly improved the overload resolution debugging tools
    • prelude: started adding some extra error detection for small things that don't need to be builtin
    • prelude: started working on implementing #for for tuples, some stuff needs to be addressed still
    • fixed some type checking issue with wrapped args
    • fixed superfluous nested lifetime scope in brace blocks (which caused redundant calls to some extension points)
    (user: zlodo size: 3363)

To Artifact [f3b69ef5bb]:

  • File bs/builtins/types/overloadset/helpers.cpp — part of check-in [0db147f117] at 2024-09-15 20:24:31 on branch cir-ssa-refactor — Add clang format settings, reformat everything (user: achavasse size: 3432)

53
54
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
83
84
85
86
87
88
89
90
91
92

93
94
95
96
97
98
99
100
            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, LocationId loc )
    {
        assert( pOvlSet );

        Context localC( c.env(), c.identity(), GetValueType< uint32_t >() );
        localC.setBuilder( c.builder() );

        execute::VM vm;

        if( !args.isConstant() && cir::CanValueBeEagerlyEvaluated( args ) )
            args = execute::Evaluate( args, vm );
        if( args.isPoison() )
            return PoisonValue();


        auto val = ResolveInvocation( localC, GetOverloadSetInvocationRule(), ToValue( pOvlSet ).setLocationId( loc ), args );

        if( val.isConstant() || !cir::CanValueBeEagerlyEvaluated( val ) )
            return val;

        return execute::Evaluate( val, vm );
    }


    Value InvokeOverloadSet( Context& c, const ptr< OverloadSet >& pOvlSet, Value args, LocationId loc )
    {
        assert( pOvlSet );

        execute::VM vm;

        if( !args.isConstant() && cir::CanValueBeEagerlyEvaluated( args ) )
            args = execute::Evaluate( args, vm );
        if( args.isPoison() )
            return PoisonValue();


        auto val = ResolveInvocation( c, GetOverloadSetInvocationRule(), ToValue( pOvlSet ).setLocationId( loc ), args );

        if( val.isConstant() || !cir::CanValueBeEagerlyEvaluated( val ) )
            return val;

        return execute::Evaluate( val, vm );
    }
}







>
|













>
|







>
|










>
|






|
53
54
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
            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, LocationId loc )
    {
        assert( pOvlSet );

        Context localC( c.env(), c.identity(), GetValueType< uint32_t >() );
        localC.setBuilder( c.builder() );

        execute::VM vm;

        if( !args.isConstant() && cir::CanValueBeEagerlyEvaluated( args ) )
            args = execute::Evaluate( args, vm );
        if( args.isPoison() )
            return PoisonValue();

        auto val = ResolveInvocation(
            localC, GetOverloadSetInvocationRule(), ToValue( pOvlSet ).setLocationId( loc ), args );

        if( val.isConstant() || !cir::CanValueBeEagerlyEvaluated( val ) )
            return val;

        return execute::Evaluate( val, vm );
    }

    Value InvokeOverloadSet(
        Context& c, const ptr< OverloadSet >& pOvlSet, Value args, LocationId loc )
    {
        assert( pOvlSet );

        execute::VM vm;

        if( !args.isConstant() && cir::CanValueBeEagerlyEvaluated( args ) )
            args = execute::Evaluate( args, vm );
        if( args.isPoison() )
            return PoisonValue();

        auto val = ResolveInvocation(
            c, GetOverloadSetInvocationRule(), ToValue( pOvlSet ).setLocationId( loc ), args );

        if( val.isConstant() || !cir::CanValueBeEagerlyEvaluated( val ) )
            return val;

        return execute::Evaluate( val, vm );
    }
} // namespace goose::builtins