Goose  Diff

Differences From Artifact [eaadd43ee0]:

  • File bs/builtins/types/overloadset/invoke.cpp — part of check-in [16dd587889] at 2021-11-16 21:18:12 on branch trunk — The details of creating a new visibility scope are now handled by the builder instead of being hardcoded in the parser (user: zlodo size: 5055)

To Artifact [47b1290337]:

  • File bs/builtins/types/overloadset/invoke.cpp — part of check-in [ead7162820] at 2022-05-09 18:52:59 on branch trunk —
    • Verifier: implemented a new encoding for memory locations that lets the verifier deal correctly with aliasing
    • Implemented test for the above
    • Fixed a reference typechecking bug to celebrate a day ending in Y
    (user: zlodo size: 5259)

1
2

3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
10


+







#include "builtins/builtins.h"

//#define OVL_TC_DEBUG_CANDIDATES
//#define OVL_TC_DEBUG

using namespace goose::sema;

namespace goose::builtins
{
    class OverloadSetInvocationRule : public InvocationRule
47
48
49
50
51
52
53




54
55
56
57
58
59
60
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65







+
+
+
+







                    TypeCheckingContext tcc( c );
                    for( auto&& [s,ovl,tcc] : pOvlSet->typeCheck( callPat, tcc ) )
                    {
                        if( tcc.numUnknownValues() )
                            continue;

                        auto subs = Substitute( s, tcc );

                    #ifdef OVL_TC_DEBUG_CANDIDATES
                        cout << "  ## CANDIDATE: " << tcc.score() << "  " << subs << endl;
                    #endif

                        // Typechecking rules often end up stripping part of the original type,
                        // and we want to invoke the overload where these removals are minimized.
                        //
                        // Obvious example: if there is an overload that accepts a reference
                        // and one that accepts a value of the same type and we started with a
                        // reference, then we want to call the overload where the typechecking