Goose  Diff

Differences From Artifact [431c202e2e]:

  • File bs/builtins/types/localvar/localvar.cpp — part of check-in [385846b609] at 2020-06-13 12:51:27 on branch trunk — Modify the reference IR representation so that we can have holes for the behavior. (user: achavasse size: 9979)

To Artifact [f37d3e80d2]:

  • File bs/builtins/types/localvar/localvar.cpp — part of check-in [947b9d7cfc] at 2020-06-13 22:59:24 on branch trunk —
    • Implemented Initialize overloads for tuples.
    • Lots of cleanup.
    (user: achavasse size: 9787)

103
104
105
106
107
108
109
110
111
112

113
114
115
116
117

118
119
120
121
122
123
124
103
104
105
106
107
108
109

110

111

112
113
114

115
116
117
118
119
120
121
122







-

-
+
-



-
+







        static auto anyTVar = ValueToIRExpr( ToValue( TVar( "_"_sid ) ) );

        // The $T texpr.
        static auto TTVar = ValueToIRExpr( ToValue( TVar( "T"_sid ) ) );

        // Create the MutRef[$T] param.
        static auto mutRefParamPattern = ValueToIRExpr( ToValue( TNamedDecl( GetValueType< Reference >( TTVar, TSID( mut ) ), "ref"_sid ) ) );
//        static auto mutRefParamPattern = ParamPat( GetValueType< Reference >( TTVar, ReferenceType::Behavior::Mutable ) );

        auto initValPattern = ValueToIRExpr( ValuePattern( TSID( constant ), initVal.type(), HOLE( "_"_sid ) ) );
        auto initValParamPattern = ValueToIRExpr( ToValue( Decl( initVal.type(), "initVal"_sid ) ) );
  //      auto initValPattern = ParamPat( initVal.type() );

        // Create the _ ( MutRef[pat], initType ) initFunc param.
        auto initFuncTFTParam = ValueToIRExpr( ToValue(
            TNamedDecl( ValueToIRExpr( ToValue( TFuncType( DomainAny(), anyTVar, VEC( move( mutRefParamPattern ), move( initValPattern ) ),
            TNamedDecl( ValueToIRExpr( ToValue( TFuncType( DomainAny(), anyTVar, VEC( move( mutRefParamPattern ), move( initValParamPattern ) ),
            make_shared< vector< TermLoc > >(), make_shared< vector< TermLoc > >() ) ) ), "initFunc"_sid ) ) );

        // Create our parameter list pattern.
        auto paramPat = VEC(
            *BuildTemplateSignature( c, TTVar ),
            *BuildTemplateSignature( c, initFuncTFTParam )
        );