Goose  Diff

Differences From Artifact [487d131fbf]:

  • File bs/builtins/helpers.h — part of check-in [d70fa1ef12] at 2023-01-30 19:33:08 on branch trunk — Implemented the _IsTrivialInitialization extension point to optimize tuple initialization in the same way as assignments (user: zlodo size: 4578)

To Artifact [ef8a45fca4]:

  • File bs/builtins/helpers.h — part of check-in [1b18849f5c] at 2023-02-07 15:49:17 on branch trunk — Removed the ToType extension point, go through typechecking instead for converting things such as tuple of types into types. This is more generic than the previous approach and will avoid some pitfalls in the future. (user: zlodo size: 4582)

28
29
30
31
32
33
34
35

36
37
38
39
40
41
42
28
29
30
31
32
33
34

35
36
37
38
39
40
41
42







-
+








    enum class ValUnifyError
    {
        NoSolution,
        Ambiguous
    };

    // Unify the provided value with a value placeholder of the specified type,
    // Typecheck the provided value with a value placeholder of the specified type,
    // and return the result or an error code.
    variant< Value, ValUnifyError > ConvertValueToType( const Context& c, const Value& val, const Term& type );

    // Helpers to create a standard type construction, as a vector starting with an identity, followed by an optional pointer to predicates
    // and an optional pointer to a llvm type.
    template< typename I, typename... T >
    auto MkStdType( I&& identity, T&&... extra )