|
| 1 | +//===--- ConstraintLocatorPathElts.def - Constraint Locator Path Elements -===// |
| 2 | +// |
| 3 | +// This source file is part of the Swift.org open source project |
| 4 | +// |
| 5 | +// Copyright (c) 2019 Apple Inc. and the Swift project authors |
| 6 | +// Licensed under Apache License v2.0 with Runtime Library Exception |
| 7 | +// |
| 8 | +// See https://swift.org/LICENSE.txt for license information |
| 9 | +// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors |
| 10 | +// |
| 11 | +//===----------------------------------------------------------------------===// |
| 12 | +/// |
| 13 | +/// This file enumerates the elements that can make up the path of a |
| 14 | +/// ConstraintLocator. |
| 15 | +/// |
| 16 | +//===----------------------------------------------------------------------===// |
| 17 | + |
| 18 | +/// Describes any kind of path element. |
| 19 | +#ifndef LOCATOR_PATH_ELT |
| 20 | +#define LOCATOR_PATH_ELT(Name) |
| 21 | +#endif |
| 22 | + |
| 23 | +/// Defines a path element which is characterized only by its kind, and as such |
| 24 | +/// doesn't store additional values. |
| 25 | +#ifndef SIMPLE_LOCATOR_PATH_ELT |
| 26 | +#define SIMPLE_LOCATOR_PATH_ELT(Name) LOCATOR_PATH_ELT(Name) |
| 27 | +#endif |
| 28 | + |
| 29 | +/// Defines a path element that requires a class definition to be provided in |
| 30 | +/// order to expose things like accessors for path element info. |
| 31 | +#ifndef CUSTOM_LOCATOR_PATH_ELT |
| 32 | +#define CUSTOM_LOCATOR_PATH_ELT(Name) LOCATOR_PATH_ELT(Name) |
| 33 | +#endif |
| 34 | + |
| 35 | +/// Defines an abstract path element superclass which doesn't itself have a path |
| 36 | +/// element kind. |
| 37 | +#ifndef ABSTRACT_LOCATOR_PATH_ELT |
| 38 | +#define ABSTRACT_LOCATOR_PATH_ELT(Name) CUSTOM_LOCATOR_PATH_ELT(Name) |
| 39 | +#endif |
| 40 | + |
| 41 | +/// Matching an argument to a parameter. |
| 42 | +CUSTOM_LOCATOR_PATH_ELT(ApplyArgToParam) |
| 43 | + |
| 44 | +/// The argument of function application. |
| 45 | +SIMPLE_LOCATOR_PATH_ELT(ApplyArgument) |
| 46 | + |
| 47 | +/// The function being applied. |
| 48 | +SIMPLE_LOCATOR_PATH_ELT(ApplyFunction) |
| 49 | + |
| 50 | +/// An argument passed in an autoclosure parameter |
| 51 | +/// position, which must match the autoclosure return type. |
| 52 | +SIMPLE_LOCATOR_PATH_ELT(AutoclosureResult) |
| 53 | + |
| 54 | +/// The result of a closure. |
| 55 | +SIMPLE_LOCATOR_PATH_ELT(ClosureResult) |
| 56 | + |
| 57 | +/// The lookup for a constructor member. |
| 58 | +SIMPLE_LOCATOR_PATH_ELT(ConstructorMember) |
| 59 | + |
| 60 | +/// The desired contextual type passed in to the constraint system. |
| 61 | +CUSTOM_LOCATOR_PATH_ELT(ContextualType) |
| 62 | + |
| 63 | +/// A result of an expression involving dynamic lookup. |
| 64 | +SIMPLE_LOCATOR_PATH_ELT(DynamicLookupResult) |
| 65 | + |
| 66 | +/// The superclass of a protocol existential type. |
| 67 | +SIMPLE_LOCATOR_PATH_ELT(ExistentialSuperclassType) |
| 68 | + |
| 69 | +/// The argument type of a function. |
| 70 | +SIMPLE_LOCATOR_PATH_ELT(FunctionArgument) |
| 71 | + |
| 72 | +/// The result type of a function. |
| 73 | +SIMPLE_LOCATOR_PATH_ELT(FunctionResult) |
| 74 | + |
| 75 | +/// A generic argument. |
| 76 | +/// FIXME: Add support for named generic arguments? |
| 77 | +CUSTOM_LOCATOR_PATH_ELT(GenericArgument) |
| 78 | + |
| 79 | +/// Locator for a binding from an IUO disjunction choice. |
| 80 | +SIMPLE_LOCATOR_PATH_ELT(ImplicitlyUnwrappedDisjunctionChoice) |
| 81 | + |
| 82 | +/// The instance of a metatype type. |
| 83 | +SIMPLE_LOCATOR_PATH_ELT(InstanceType) |
| 84 | + |
| 85 | +/// A generic parameter being opened. |
| 86 | +/// |
| 87 | +/// Also contains the generic parameter type itself. |
| 88 | +CUSTOM_LOCATOR_PATH_ELT(GenericParameter) |
| 89 | + |
| 90 | +/// A component of a key path. |
| 91 | +CUSTOM_LOCATOR_PATH_ELT(KeyPathComponent) |
| 92 | + |
| 93 | +/// The result type of a key path component. Not used for subscripts. |
| 94 | +SIMPLE_LOCATOR_PATH_ELT(KeyPathComponentResult) |
| 95 | + |
| 96 | +/// The member looked up via keypath based dynamic lookup. |
| 97 | +CUSTOM_LOCATOR_PATH_ELT(KeyPathDynamicMember) |
| 98 | + |
| 99 | +/// The root of a key path. |
| 100 | +SIMPLE_LOCATOR_PATH_ELT(KeyPathRoot) |
| 101 | + |
| 102 | +/// The type of the key path expression. |
| 103 | +SIMPLE_LOCATOR_PATH_ELT(KeyPathType) |
| 104 | + |
| 105 | +/// The value of a key path. |
| 106 | +SIMPLE_LOCATOR_PATH_ELT(KeyPathValue) |
| 107 | + |
| 108 | +/// An implicit @lvalue-to-inout conversion; only valid for operator |
| 109 | +/// arguments. |
| 110 | +SIMPLE_LOCATOR_PATH_ELT(LValueConversion) |
| 111 | + |
| 112 | +/// A member. |
| 113 | +/// FIXME: Do we need the actual member name here? |
| 114 | +SIMPLE_LOCATOR_PATH_ELT(Member) |
| 115 | + |
| 116 | +/// The base of a member expression. |
| 117 | +SIMPLE_LOCATOR_PATH_ELT(MemberRefBase) |
| 118 | + |
| 119 | +/// This is referring to a type produced by opening a generic type at the |
| 120 | +/// base of the locator. |
| 121 | +CUSTOM_LOCATOR_PATH_ELT(OpenedGeneric) |
| 122 | + |
| 123 | +/// An optional payload. |
| 124 | +SIMPLE_LOCATOR_PATH_ELT(OptionalPayload) |
| 125 | + |
| 126 | +/// The parent of a nested type. |
| 127 | +SIMPLE_LOCATOR_PATH_ELT(ParentType) |
| 128 | + |
| 129 | +/// The requirement that we're matching during protocol conformance |
| 130 | +/// checking. |
| 131 | +CUSTOM_LOCATOR_PATH_ELT(Requirement) |
| 132 | + |
| 133 | +/// Type parameter requirements. |
| 134 | +ABSTRACT_LOCATOR_PATH_ELT(AnyRequirement) |
| 135 | + /// The Nth conditional requirement in the parent locator's conformance. |
| 136 | + CUSTOM_LOCATOR_PATH_ELT(ConditionalRequirement) |
| 137 | + |
| 138 | + /// A single requirement placed on the type parameters. |
| 139 | + CUSTOM_LOCATOR_PATH_ELT(TypeParameterRequirement) |
| 140 | + |
| 141 | +/// RValue adjustment. |
| 142 | +SIMPLE_LOCATOR_PATH_ELT(RValueAdjustment) |
| 143 | + |
| 144 | +/// The element type of a sequence in a for ... in ... loop. |
| 145 | +SIMPLE_LOCATOR_PATH_ELT(SequenceElementType) |
| 146 | + |
| 147 | +/// The lookup for a subscript member. |
| 148 | +SIMPLE_LOCATOR_PATH_ELT(SubscriptMember) |
| 149 | + |
| 150 | +/// The missing argument synthesized by the solver. |
| 151 | +CUSTOM_LOCATOR_PATH_ELT(SynthesizedArgument) |
| 152 | + |
| 153 | +/// Tuple elements. |
| 154 | +ABSTRACT_LOCATOR_PATH_ELT(AnyTupleElement) |
| 155 | + /// A tuple element referenced by position. |
| 156 | + CUSTOM_LOCATOR_PATH_ELT(TupleElement) |
| 157 | + |
| 158 | + /// A tuple element referenced by name. |
| 159 | + CUSTOM_LOCATOR_PATH_ELT(NamedTupleElement) |
| 160 | + |
| 161 | +/// An unresolved member. |
| 162 | +SIMPLE_LOCATOR_PATH_ELT(UnresolvedMember) |
| 163 | + |
| 164 | +/// The candidate witness during protocol conformance checking. |
| 165 | +CUSTOM_LOCATOR_PATH_ELT(Witness) |
| 166 | + |
| 167 | +#undef LOCATOR_PATH_ELT |
| 168 | +#undef CUSTOM_LOCATOR_PATH_ELT |
| 169 | +#undef SIMPLE_LOCATOR_PATH_ELT |
| 170 | +#undef ABSTRACT_LOCATOR_PATH_ELT |
0 commit comments