MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / isSameType

Function isSameType

src/simulate/debug_info.cpp:389–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387 }
388
389 bool isSameType ( const TypeInfo * THIS,
390 const TypeInfo * decl,
391 RefMatters refMatters,
392 ConstMatters constMatters,
393 TemporaryMatters temporaryMatters,
394 bool topLevel ) {
395 if ( topLevel && !isPointer(THIS) && !THIS->isRef() ) {
396 constMatters = ConstMatters::no;
397 }
398 if ( THIS->type != decl->type ) {
399 return false;
400 }
401 if ( THIS->type==Type::tHandle && THIS->getAnnotation()!=decl->getAnnotation() ) {
402 return false;
403 }
404 if ( THIS->type==Type::tStructure && THIS->structType->hash!=decl->structType->hash ) {
405 return false;
406 }
407 if ( THIS->type==Type::tPointer || THIS->type==Type::tIterator ) {
408 if ( (THIS->firstType && !isVoid(THIS->firstType))
409 && (decl->firstType && !isVoid(decl->firstType))
410 && !isSameType(THIS->firstType, decl->firstType, RefMatters::yes, ConstMatters::yes, TemporaryMatters::yes, false) ) {
411 return false;
412 }
413
414 }
415 if ( THIS->type==Type::tEnumeration || THIS->type==Type::tEnumeration8 ||
416 THIS->type==Type::tEnumeration16 || THIS->type==Type::tEnumeration64 ) {
417 if ( THIS->type != decl->type ) {
418 return false;
419 }
420 if ( THIS->enumType && decl->enumType && THIS->enumType->hash!=decl->enumType->hash ) {
421 return false;
422 }
423 }
424 if ( THIS->type==Type::tArray ) {
425 if ( THIS->firstType && decl->firstType && !isSameType(THIS->firstType, decl->firstType,
426 RefMatters::yes, ConstMatters::yes, TemporaryMatters::yes, false) ) {
427 return false;
428 }
429 }
430 if ( THIS->type==Type::tTable ) {
431 if ( THIS->firstType && decl->firstType && !isSameType(THIS->firstType, decl->firstType,
432 RefMatters::yes, ConstMatters::yes, TemporaryMatters::yes, false) ) {
433 return false;
434 }
435 if ( THIS->secondType && decl->secondType && !isSameType(THIS->secondType, decl->secondType,
436 RefMatters::yes, ConstMatters::yes, TemporaryMatters::yes, false) ) {
437 return false;
438 }
439 }
440 if ( THIS->type==Type::tBlock || THIS->type==Type::tFunction
441 || THIS->type==Type::tLambda || THIS->type==Type::tTuple
442 || THIS->type==Type::tVariant ) {
443 if ( THIS->firstType && decl->firstType && !isSameType(THIS->firstType, decl->firstType,
444 RefMatters::yes, ConstMatters::yes, TemporaryMatters::yes, false) ) {
445 return false;
446 }

Callers 3

isValidArgumentTypeFunction · 0.85
isMatchingArgumentTypeFunction · 0.85
isCompatibleCastFunction · 0.85

Calls 6

isPointerFunction · 0.85
isVoidFunction · 0.85
isRefMethod · 0.80
getAnnotationMethod · 0.80
isConstMethod · 0.80
isTempMethod · 0.45

Tested by

no test coverage detected