mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
These will be used for unit-testing the Type::join functionality in the type checker. The result of the join is replaced during constraint generation with the actual type. There is currently no checking for whether the arguments can be used to statically compute the value, so bad things will likely happen if e.g. they are type variables. Once more of the basic functionality of Type::join is working I'll make this a bit more bullet-proof in that regard. They include: // Compute the join of T and U and return the metatype of that type. Builtin.type_join<T, U, V>(_: T.Type, _: U.Type) -> V.Type // Compute the join of &T and U and return the metatype of that type. Builtin.type_join_inout<T, U, V>(_: inout T, _: U.Type) -> V.Type // Compute the join of T.Type and U.Type and return that type. Builtin.type_join_meta<T, U, V>(_: T.Type, _: U.Type) -> V.Type I've added a couple simple tests to start off, based on what currently works (aka doesn't cause an assert, crash, etc.).
2.8 KiB
2.8 KiB