102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
// Create the _ texpr.
static auto anyTVar = ValueToEIR( ToValue( TVar( "_"_sid ) ) );
// The $T texpr.
static auto TTVar = ValueToEIR( ToValue( TVar( "T"_sid ) ) );
// Create the MutRef[$T] param.
static auto mutRefParamPattern = ValueToEIR( ToValue( TNamedDecl( GetValueType< Reference >( TTVar, TSID( mut ) ), "ref"_sid ) ) );
auto initValParamPattern = ValueToEIR( ToValue( Decl( initVal.type(), "initVal"_sid ) ) );
// Create the _ ( MutRef[pat], initType ) initFunc param.
auto initFuncTFTParam = ValueToEIR( ToValue(
TNamedDecl( ValueToEIR( ToValue( TFuncType( anyTVar, VEC( move( mutRefParamPattern ), move( initValParamPattern ) ),
make_shared< vector< TermLoc > >(), make_shared< vector< TermLoc > >() ) ) ), "initFunc"_sid ) ) );
|
|
>
|
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
// Create the _ texpr.
static auto anyTVar = ValueToEIR( ToValue( TVar( "_"_sid ) ) );
// The $T texpr.
static auto TTVar = ValueToEIR( ToValue( TVar( "T"_sid ) ) );
// Create the MutRef[$T] param.
static auto mutRefParamPattern = ValueToEIR( ToValue( TNamedDecl(
ValueToEIR( ToValue( ReferenceType{ TTVar, TSID( mut ) } ) ), "ref"_sid ) ) );
auto initValParamPattern = ValueToEIR( ToValue( Decl( initVal.type(), "initVal"_sid ) ) );
// Create the _ ( MutRef[pat], initType ) initFunc param.
auto initFuncTFTParam = ValueToEIR( ToValue(
TNamedDecl( ValueToEIR( ToValue( TFuncType( anyTVar, VEC( move( mutRefParamPattern ), move( initValParamPattern ) ),
make_shared< vector< TermLoc > >(), make_shared< vector< TermLoc > >() ) ) ), "initFunc"_sid ) ) );
|