Skip to content
← Back

src/semantic/callee_parameter_slot.ghul

1
namespace Semantic is
2
use Types.Type
3
4
// Answers whether an argument sits in a slot typed by one of the
5
// callee's own type parameters.
6
//
7
// A placeholder argument in such a slot takes part in binding that
8
// parameter rather than being constrained by it. The binding the
9
// resolver reaches is made from the other arguments, without the
10
// placeholder's type, so the specialised formal is no bound on the
11
// placeholder: recording it as one would hold the placeholder under
12
// a type its own later assignments may need to widen.
13
class CALLEE_PARAMETER_SLOT is
14
init() is si
15
16
binds_placeholder(unspecialized_formal: Type, actual: Type, caller: Symbols.Function?) -> bool =>
17
isa Types.INFERRED_VARIABLE_TYPE(actual) /\
18
unspecialized_formal.is_type_variable /\
19
unspecialized_formal.has_function_generic_argument_foreign_to(caller)
20
si
21
si