Goose  Diff

Differences From Artifact [e8725b5e7a]:

  • File bs/builtins/types/reference/typecheck.cpp — part of check-in [973848d259] at 2023-12-06 20:49:19 on branch trunk — Begin implementing structs. (user: zlodo size: 10783)

To Artifact [a622140cb1]:

  • File bs/builtins/types/reference/typecheck.cpp — part of check-in [1793989d05] at 2024-02-09 18:05:28 on branch trunk — Lowering: completely reworked all lowering to happen in the same two unified extension points upstream of all three CIR consumers (user: zlodo size: 10791)

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
            .setLocationId( lvval.locationId() ) );

        co_yield TypeCheck( lhs, ref, tcc );
    }

    TCGen TypeCheckingDereference( const Term& lhs, const Term& rhs, TypeCheckingContext tcc )
    {
        auto refval = EIRToValue( rhs );
        if( !refval )
            co_return;

        auto refType = FromValue< ReferenceType >( *EIRToValue( refval->type() ) );
        if( !refType )
            co_return;

        auto loc = refval->locationId() ;
        auto content = ValueToEIR( BuildComputedValue( refType->type(),
            *refval, cir::Load( refType->type(), loc ) )
            .setLocationId( loc ) );

        // TypeCheck the param with the ref's content
        co_yield TypeCheck( lhs, content, tcc );
    }

    TCGen TypeCheckingBuildTempRef( const Term& lhs, const Term& rhs, const TypeCheckingContext& tcc )
    {
        auto lRefType = *FromValue< ReferenceType >( *EIRToValue( EIRToValuePattern( lhs )->type() ) );
        if( IsMutReferenceType( lRefType ) )
            co_return;







|
|


|



|

|



|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
            .setLocationId( lvval.locationId() ) );

        co_yield TypeCheck( lhs, ref, tcc );
    }

    TCGen TypeCheckingDereference( const Term& lhs, const Term& rhs, TypeCheckingContext tcc )
    {
        auto refVal = EIRToValue( rhs );
        if( !refVal )
            co_return;

        auto refType = FromValue< ReferenceType >( *EIRToValue( refVal->type() ) );
        if( !refType )
            co_return;

        auto loc = refVal->locationId() ;
        auto content = ValueToEIR( BuildComputedValue( refType->type(),
            *refVal, cir::Load( refType->type(), loc ) )
            .setLocationId( loc ) );

        // TypeCheck the param with the ref's content
        co_yield TypeCheck( lhs, move( content ), tcc );
    }

    TCGen TypeCheckingBuildTempRef( const Term& lhs, const Term& rhs, const TypeCheckingContext& tcc )
    {
        auto lRefType = *FromValue< ReferenceType >( *EIRToValue( EIRToValuePattern( lhs )->type() ) );
        if( IsMutReferenceType( lRefType ) )
            co_return;