Goose  Diff

Differences From Artifact [64885b3d2f]:

  • File bs/builtins/types/template/tc-tdecl.cpp — part of check-in [0345b9f807] at 2021-01-02 18:00:11 on branch trunk — Some more renaming. (user: achavasse size: 7749)

To Artifact [ebe39847e3]:

  • File bs/builtins/types/template/tc-tdecl.cpp — part of check-in [3bf30e74ac] at 2021-01-13 11:46:18 on branch trunk — Sema: simplification: the "half-unification" rules don't need to be generators, they can only output one result. (user: achavasse size: 7734)

41
42
43
44
45
46
47
48

49
50
51
52
53
54
55
41
42
43
44
45
46
47

48
49
50
51
52
53
54
55







-
+







    }

    void SetupTDeclTypeChecking( Env& e )
    {
        auto tDeclPat = ValueToEIR( Value( GetValueType< TDecl >(), VEC( ANYTERM( _ ), ANYTERM( _ ) ) ) );

        e.typeCheckingRuleSet()->addHalfUnificationRule( TCRINFOS, tDeclPat,
            []( const Term& lhs, const TypeCheckingContext& c ) -> TCGen
            []( const Term& lhs, TypeCheckingContext& c )
            {
                auto tdecl = FromValue< TDecl >( *ValueFromEIR( lhs ) );
                assert( tdecl );
                return HalfUnify( tdecl->type(), c );
            } );

        e.typeCheckingRuleSet()->addTypeCheckingRule( TCRINFOS, tDeclPat, ANYTERM( _ ), UnifyTDecl );