Uploaded image for project: 'Swift'
  1. Swift
  2. SR-4786

Infinite recursion in compareDependentTypes/getArchetypeAnchor with associated types with incompatible bounds

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: Compiler
    • Labels:
      None
    • Environment:

      aa8d64c04e (2017-04-30)

      Description

      public protocol _UTFEncoding {
          associatedtype EncodedScalar where EncodedScalar == Int
      }
      
      public protocol UnicodeEncoding {
          associatedtype EncodedScalar: BidirectionalCollection
      }
      
      public protocol _UTFParser {
          associatedtype Encoding: UnicodeEncoding, _UTFEncoding
      }
      
        * frame #0: 0x0000000100febda5 swift`compareDependentTypes(pa=0x00007fff5fbec598, pb=0x00007fff5fbec5a0) at GenericSignatureBuilder.cpp:1415 [opt]
          frame #1: 0x0000000100fec09e swift`compareDependentTypes(pa=<unavailable>, pb=<unavailable>) at GenericSignatureBuilder.cpp:1438 [opt]
          frame #2: 0x0000000100fec09e swift`compareDependentTypes(pa=<unavailable>, pb=<unavailable>) at GenericSignatureBuilder.cpp:1438 [opt]
          frame #3: 0x0000000100fec09e swift`compareDependentTypes(pa=<unavailable>, pb=<unavailable>) at GenericSignatureBuilder.cpp:1438 [opt]
          frame #4: 0x0000000100fec09e swift`compareDependentTypes(pa=<unavailable>, pb=<unavailable>) at GenericSignatureBuilder.cpp:1438 [opt]
          frame #5: 0x0000000100fec09e swift`compareDependentTypes(pa=<unavailable>, pb=<unavailable>) at GenericSignatureBuilder.cpp:1438 [opt]
          frame #6: 0x0000000100fec09e swift`compareDependentTypes(pa=<unavailable>, pb=<unavailable>) at GenericSignatureBuilder.cpp:1438 [opt]
          frame #7: 0x0000000100fec09e swift`compareDependentTypes(pa=<unavailable>, pb=<unavailable>) at GenericSignatureBuilder.cpp:1438 [opt]
          frame #8: 0x0000000100fec09e swift`compareDependentTypes(pa=<unavailable>, pb=<unavailable>) at GenericSignatureBuilder.cpp:1438 [opt]
          frame #9: 0x0000000100fec09e swift`compareDependentTypes(pa=<unavailable>, pb=<unavailable>) at GenericSignatureBuilder.cpp:1438 [opt]
          frame #10: 0x0000000100fec09e swift`compareDependentTypes(pa=<unavailable>, pb=<unavailable>) at GenericSignatureBuilder.cpp:1438 [opt]
      
      ...
      
          frame #398: 0x0000000100fec09e swift`compareDependentTypes(pa=<unavailable>, pb=<unavailable>) at GenericSignatureBuilder.cpp:1438 [opt]
          frame #399: 0x0000000100fec09e swift`compareDependentTypes(pa=<unavailable>, pb=<unavailable>) at GenericSignatureBuilder.cpp:1438 [opt]
          frame #400: 0x0000000100feb4e7 swift`swift::GenericSignatureBuilder::PotentialArchetype::getArchetypeAnchor(this=<unavailable>, builder=<unavailable>) at GenericSignatureBuilder.cpp:1511 [opt]
          frame #401: 0x0000000100feb235 swift`swift::GenericSignatureBuilder::PotentialArchetype::getArchetypeAnchor(this=0x000000010591f260, builder=0x00007fff5fbfc290) at GenericSignatureBuilder.cpp:1490 [opt]
          frame #402: 0x0000000100feb235 swift`swift::GenericSignatureBuilder::PotentialArchetype::getArchetypeAnchor(this=0x000000010591f520, builder=0x00007fff5fbfc290) at GenericSignatureBuilder.cpp:1490 [opt]
      
      ...
      
          frame #598: 0x0000000100feb235 swift`swift::GenericSignatureBuilder::PotentialArchetype::getArchetypeAnchor(this=0x0000000105a239d0, builder=0x00007fff5fbfc290) at GenericSignatureBuilder.cpp:1490 [opt]
          frame #599: 0x0000000100feb235 swift`swift::GenericSignatureBuilder::PotentialArchetype::getArchetypeAnchor(this=0x0000000105a23c90, builder=0x00007fff5fbfc290) at GenericSignatureBuilder.cpp:1490 [opt]
          frame #600: 0x0000000100feb235 swift`swift::GenericSignatureBuilder::PotentialArchetype::getArchetypeAnchor(this=0x0000000105a23f50, builder=0x00007fff5fbfc290) at GenericSignatureBuilder.cpp:1490 [opt]
          frame #601: 0x0000000100feb235 swift`swift::GenericSignatureBuilder::PotentialArchetype::getArchetypeAnchor(this=0x0000000105a24210, builder=0x00007fff5fbfc290) at GenericSignatureBuilder.cpp:1490 [opt]
          frame #602: 0x0000000100feb235 swift`swift::GenericSignatureBuilder::PotentialArchetype::getArchetypeAnchor(this=0x0000000105a244d0, builder=0x00007fff5fbfc290) at GenericSignatureBuilder.cpp:1490 [opt]
          frame #603: 0x0000000100ff78ea swift`swift::GenericSignatureBuilder::finalize(swift::SourceLoc, llvm::ArrayRef<swift::GenericTypeParamType*>, bool) at GenericSignatureBuilder.cpp:4858 [opt]
          frame #604: 0x0000000100ff74c0 swift`swift::GenericSignatureBuilder::finalize(this=<unavailable>, loc=<unavailable>, genericParams=<unavailable>, allowConcreteGenericParams=<unavailable>) at GenericSignatureBuilder.cpp:3864 [opt]
          frame #605: 0x0000000100ea71fd swift`swift::TypeChecker::checkGenericEnvironment(this=0x00007fff5fbfc8d8, genericParams=0x000000010739e0c8, dc=0x00000001074472a0, parentSig=<unavailable>, allowConcreteGenericParams=<unavailable>, inferRequirements=function_ref<void (swift::GenericSignatureBuilder &)> @ 0x00007fff5fbfc360)>) at TypeCheckGeneric.cpp:1168 [opt]
          frame #606: 0x0000000100ea7622 swift`swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) [inlined] swift::TypeChecker::checkGenericEnvironment(this=0x00007fff5fbfc8d8, genericParams=<unavailable>, outerSignature=<unavailable>, allowConcreteGenericParams=false) at TypeChecker.h:1316 [opt]
          frame #607: 0x0000000100ea75ea swift`swift::TypeChecker::validateGenericTypeSignature(this=0x00007fff5fbfc8d8, typeDecl=<unavailable>) at TypeCheckGeneric.cpp:1234 [opt]
          frame #608: 0x0000000100e7c5d2 swift`swift::TypeChecker::validateDecl(this=0x00007fff5fbfc8d8, D=0x0000000107449dd0) at TypeCheckDecl.cpp:7150 [opt]
          frame #609: 0x0000000100e8aee6 swift`(anonymous namespace)::DeclChecker::visitProtocolDecl(this=0x00007fff5fbfc878, PD=0x0000000107449dd0) at TypeCheckDecl.cpp:4577 [opt]
          frame #610: 0x0000000100e7ab57 swift`(anonymous namespace)::DeclChecker::visit(swift::Decl*) [inlined] swift::ASTVisitor<(anonymous namespace)::DeclChecker, void, void, void, void, void, void>::visit(D=0x0000000107449dd0) at DeclNodes.def:115 [opt]
          frame #611: 0x0000000100e7a9cd swift`(anonymous namespace)::DeclChecker::visit(this=0x00007fff5fbfc878, decl=0x0000000107449dd0) at TypeCheckDecl.cpp:3813 [opt]
          frame #612: 0x0000000100e7a974 swift`swift::TypeChecker::typeCheckDecl(this=0x00007fff5fbfc8d8, D=0x0000000107449dd0, isFirstPass=true) at TypeCheckDecl.cpp:6935 [opt]
          frame #613: 0x0000000100efbc84 swift`swift::performTypeChecking(SF=<unavailable>, TLC=0x00007fff5fbfceb8, Options=<unavailable>, StartElem=<unavailable>, WarnLongFunctionBodies=<unavailable>) at TypeChecker.cpp:700 [opt]
          frame #614: 0x0000000100a6b3ff swift`swift::CompilerInstance::performSema(this=<unavailable>) at Frontend.cpp:520 [opt]
          frame #615: 0x0000000100043c8c swift`performCompile(Instance=0x00007fff5fbfe630, Invocation=0x00007fff5fbfd768, Args=<unavailable>, ReturnValue=0x00007fff5fbfe5f4, observer=0x0000000000000000, Stats=0x00007fff5fbfdd60) at FrontendTool.cpp:499 [opt]
          frame #616: 0x000000010004282d swift`swift::performFrontend(Args=<unavailable>, Argv0=<unavailable>, MainAddr=<unavailable>, observer=0x0000000000000000) at FrontendTool.cpp:1193 [opt]
          frame #617: 0x0000000100004676 swift`main(argc_=<unavailable>, argv_=<unavailable>) at driver.cpp:160 [opt]
          frame #618: 0x00007fffeb2fc235 libdyld.dylib`start + 1
          frame #619: 0x00007fffeb2fc235 libdyld.dylib`start + 1
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              huon Huon Wilson
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: