Lines Matching refs:target
25 void Identity(TypeRelation *const relation, Type *const source, Type *const target)
27 relation->IsIdenticalTo(source, target);
30 void WideningPrimitive(TypeRelation *const relation, Type *const source, Type *const target)
32 ASSERT(source->HasTypeFlag(TypeFlag::ETS_PRIMITIVE) && target->HasTypeFlag(TypeFlag::ETS_PRIMITIVE));
34 WideningConverter(relation->GetChecker()->AsETSChecker(), relation, target, source);
37 void NarrowingPrimitive(TypeRelation *const relation, Type *const source, Type *const target)
39 ASSERT(source->HasTypeFlag(TypeFlag::ETS_PRIMITIVE) && target->HasTypeFlag(TypeFlag::ETS_PRIMITIVE));
41 NarrowingConverter(relation->GetChecker()->AsETSChecker(), relation, target, source);
44 void WideningNarrowingPrimitive(TypeRelation *const relation, ByteType *const source, CharType *const target)
51 NarrowingPrimitive(relation, tempInt, target);
54 void WideningReference(TypeRelation *const relation, ETSObjectType *const source, ETSObjectType *const target)
56 relation->IsSupertypeOf(target, source);
59 void WideningReference(TypeRelation *const relation, ETSArrayType *const source, ETSObjectType *const target)
61 relation->IsSupertypeOf(target, source);
64 void WideningReference(TypeRelation *const relation, ETSArrayType *const source, ETSArrayType *const target)
66 relation->IsSupertypeOf(target, source);
72 ETSObjectType *const target)
77 if (relation->IsSupertypeOf(target, source) || relation->IsSupertypeOf(source, target)) {
82 if (source->HasObjectFlag(ETSObjectFlags::INTERFACE) && target->HasObjectFlag(ETSObjectFlags::INTERFACE)) {
87 if (source->HasObjectFlag(ETSObjectFlags::CLASS) && target->HasObjectFlag(ETSObjectFlags::INTERFACE) &&
94 if (source->HasObjectFlag(ETSObjectFlags::CLASS) && target->HasObjectFlag(ETSObjectFlags::INTERFACE) &&
95 source->GetDeclNode()->IsFinal() && relation->IsSupertypeOf(source, target)) {
100 if (source->HasObjectFlag(ETSObjectFlags::INTERFACE) && target->HasObjectFlag(ETSObjectFlags::CLASS) &&
101 !target->GetDeclNode()->IsFinal()) {
108 if (source->HasObjectFlag(ETSObjectFlags::INTERFACE) && target->HasObjectFlag(ETSObjectFlags::CLASS) &&
109 target->GetDeclNode()->IsFinal() && relation->IsSupertypeOf(target, source)) {
114 return relation->IsIdenticalTo(etsChecker->GetNonConstantType(source), etsChecker->GetNonConstantType(target));
117 bool IsAllowedNarrowingReferenceConversion(TypeRelation *const relation, Type *const source, Type *const target)
120 target->HasTypeFlag(checker::TypeFlag::ETS_ARRAY_OR_OBJECT));
128 if (relation->IsSupertypeOf(target, source)) {
138 if (source->HasTypeFlag(TypeFlag::ETS_OBJECT) && target->HasTypeFlag(TypeFlag::ETS_OBJECT)) {
140 target->AsETSObjectType())) {
145 if (source->HasTypeFlag(TypeFlag::ETS_OBJECT) && target->HasTypeFlag(TypeFlag::ETS_ARRAY)) {
152 if (source->HasTypeFlag(TypeFlag::ETS_ARRAY) && target->HasTypeFlag(TypeFlag::ETS_ARRAY)) {
156 auto *tc = target->AsETSArrayType()->ElementType();
188 [[maybe_unused]] Type *const source, [[maybe_unused]] Type *const target)
191 target->HasTypeFlag(checker::TypeFlag::ETS_ARRAY_OR_OBJECT));
208 void NarrowingReferenceImpl(TypeRelation *const relation, Type *const source, Type *const target)
210 ASSERT(target->HasTypeFlag(checker::TypeFlag::ETS_ARRAY_OR_OBJECT));
212 if (!IsAllowedNarrowingReferenceConversion(relation, source, target)) {
217 if (!IsUncheckedNarrowingReferenceConversion(relation, source, target)) {
225 void NarrowingReference(TypeRelation *const relation, ETSObjectType *const source, ETSObjectType *const target)
227 NarrowingReferenceImpl(relation, source, target);
230 void NarrowingReference(TypeRelation *const relation, ETSArrayType *const source, ETSArrayType *const target)
232 if (source->ElementType()->IsETSArrayType() && target->ElementType()->IsETSArrayType()) {
233 NarrowingReference(relation, source->ElementType()->AsETSArrayType(), target->ElementType()->AsETSArrayType());
237 NarrowingReferenceImpl(relation, source, target);
240 void NarrowingReference(TypeRelation *const relation, ETSObjectType *const source, ETSArrayType *const target)
242 if (target->ElementType()->IsETSArrayType()) {
243 NarrowingReference(relation, source, target->ElementType()->AsETSArrayType());
247 NarrowingReferenceImpl(relation, source, target);
281 void UnboxingWideningPrimitive(TypeRelation *const relation, ETSObjectType *const source, Type *const target)
288 WideningPrimitive(relation, target, unboxedSource);
292 void UnboxingNarrowingPrimitive(TypeRelation *const relation, ETSObjectType *const source, Type *const target)
299 NarrowingPrimitive(relation, target, unboxedSource);
302 void UnboxingWideningNarrowingPrimitive(TypeRelation *const relation, ETSObjectType *const source, Type *const target)
309 WideningNarrowingPrimitive(relation, unboxedSource->AsByteType(), target->AsCharType());
312 void NarrowingReferenceUnboxing(TypeRelation *const relation, ETSObjectType *const source, Type *const target)
314 auto *const boxedTarget = relation->GetChecker()->AsETSChecker()->PrimitiveTypeAsETSBuiltinType(target);
326 void BoxingWideningReference(TypeRelation *const relation, Type *const source, ETSObjectType *const target)
333 WideningReference(relation, boxedSource, target);