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

Method isSameType

src/ast/ast_typedecl.cpp:1665–1899  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1663 }
1664
1665 bool TypeDecl::isSameType ( const TypeDecl & decl,
1666 RefMatters refMatters,
1667 ConstMatters constMatters,
1668 TemporaryMatters temporaryMatters,
1669 AllowSubstitute allowSubstitute,
1670 bool topLevel,
1671 bool isPassType ) const {
1672 if ( baseType!=decl.baseType ) {
1673 return false;
1674 }
1675 if ( topLevel && !isPointer() && !isRef() ) {
1676 constMatters = ConstMatters::no;
1677 }
1678 if ( topLevel && !isTempType() ) {
1679 temporaryMatters = TemporaryMatters::no;
1680 }
1681 if ( refMatters == RefMatters::yes ) {
1682 if ( ref!=decl.ref ) {
1683 return false;
1684 }
1685 }
1686 if ( constMatters == ConstMatters::yes ) {
1687 if ( constant!=decl.constant ) {
1688 return false;
1689 }
1690 }
1691 if ( temporaryMatters == TemporaryMatters::yes ) {
1692 if ( temporary != decl.temporary ) {
1693 return false;
1694 }
1695 }
1696 if ( dim!=decl.dim ) {
1697 return false;
1698 }
1699 switch ( baseType ) {
1700 case Type::tHandle:
1701 if ( annotation!=decl.annotation ) {
1702 if ( !isExplicit && (allowSubstitute == AllowSubstitute::yes) ) {
1703 if ( annotation->canSubstitute(decl.annotation) ) {
1704 return true;
1705 } else if ( decl.annotation->canBeSubstituted(annotation) ) {
1706 return true;
1707 }
1708 }
1709 return false;
1710 }
1711 break;
1712 case Type::tStructure:
1713 if (structType!=decl.structType ) {
1714 if ( !isExplicit && (allowSubstitute == AllowSubstitute::yes) ) {
1715 if ( structType && decl.structType && structType->isCompatibleCast(*(decl.structType)) ){
1716 return true;
1717 }
1718 }
1719 return false;
1720 }
1721 break;
1722 case Type::tPointer:

Callers 15

reportOp2ErrorsMethod · 0.80
visitArgumentInitMethod · 0.80
visitMethod · 0.80
preVisitMethod · 0.80
hasExtraCloneForMethod · 0.80
canOperateOnPointersMethod · 0.80
visitMethod · 0.80
canCopyOrMoveTypeMethod · 0.80
isMatchingArgumentMethod · 0.80
tryPipedCallPaddingMethod · 0.80

Calls 9

isPointerFunction · 0.85
isRefFunction · 0.85
isTempTypeFunction · 0.85
canBeSubstitutedMethod · 0.80
isCompatibleCastMethod · 0.80
isVoidMethod · 0.80
canSubstituteMethod · 0.45
sizeMethod · 0.45
isRefTypeMethod · 0.45

Tested by

no test coverage detected