Lines Matching refs:source

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)
47 WideningPrimitive(relation, source, tempInt);
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);
71 bool IsAllowedNarrowingReferenceConversionObjectObject(TypeRelation *const relation, ETSObjectType *const source,
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) &&
88 !source->GetDeclNode()->IsFinal()) {
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) &&
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)
119 ASSERT(source->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)) {
139 if (IsAllowedNarrowingReferenceConversionObjectObject(relation, source->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)) {
155 auto *sc = source->AsETSArrayType()->ElementType();
188 [[maybe_unused]] Type *const source, [[maybe_unused]] Type *const target)
190 ASSERT(source->HasTypeFlag(checker::TypeFlag::ETS_ARRAY_OR_OBJECT) &&
208 void NarrowingReferenceImpl(TypeRelation *const relation, Type *const source, Type *const target)
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)
243 NarrowingReference(relation, source, target->ElementType()->AsETSArrayType());
247 NarrowingReferenceImpl(relation, source, target);
257 ETSObjectType *Boxing(TypeRelation *const relation, Type *const source)
260 const BoxingConverter boxed(etsChecker, relation, source);
269 Type *Unboxing(TypeRelation *const relation, ETSObjectType *const source)
272 const UnboxingConverter unboxed(etsChecker, relation, source);
281 void UnboxingWideningPrimitive(TypeRelation *const relation, ETSObjectType *const source, Type *const target)
283 auto *const unboxedSource = Unboxing(relation, source);
292 void UnboxingNarrowingPrimitive(TypeRelation *const relation, ETSObjectType *const source, Type *const target)
294 auto *const unboxedSource = Unboxing(relation, source);
302 void UnboxingWideningNarrowingPrimitive(TypeRelation *const relation, ETSObjectType *const source, Type *const target)
304 auto *const unboxedSource = Unboxing(relation, source);
312 void NarrowingReferenceUnboxing(TypeRelation *const relation, ETSObjectType *const source, Type *const target)
319 NarrowingReference(relation, source, boxedTarget->AsETSObjectType());
326 void BoxingWideningReference(TypeRelation *const relation, Type *const source, ETSObjectType *const target)
328 auto *const boxedSource = Boxing(relation, source);
337 void String(TypeRelation *const relation, Type *const source)
339 if (source->HasTypeFlag(TypeFlag::BYTE | TypeFlag::SHORT)) {
341 WideningPrimitive(relation, source, tempInt);
347 if (source->HasTypeFlag(TypeFlag::ETS_BOOLEAN | TypeFlag::CHAR | TypeFlag::INT | TypeFlag::LONG | TypeFlag::FLOAT |
349 Boxing(relation, source);
354 ASSERT(source->HasTypeFlag(TypeFlag::ETS_OBJECT));