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

Assertion failed: (resultTy->hasUnresolvedType() && "Should have a selected member if we got a type")

    XMLWordPrintable

    Details

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

      Apple Swift version 3.0-dev (LLVM 17c4c6cf7a, Clang 4ca9e01a7c, Swift 31bbb2c208)
      Target: x86_64-apple-macosx10.9

      Description

      Compiling this library (requires ParserCombinator 0.1.4) results in compiler crash. It fails on Parser/Grammar.swift:95.

      The project used to compile on one of earlier versions of swift this year, but I don't have them installed any more.

      Crash output:

      $ swift build
      Compile Swift Module 'Parser' (6 sources)
      Assertion failed: (resultTy->hasUnresolvedType() && "Should have a selected member if we got a type"), function applyMemberRefExpr, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/Sema/CSApply.cpp, line 2518.
      0  swift                    0x000000010645130b llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 43
      1  swift                    0x0000000106450556 llvm::sys::RunSignalHandlers() + 70
      2  swift                    0x0000000106451a5f SignalHandler(int) + 383
      3  libsystem_platform.dylib 0x00007fff96b4352a _sigtramp + 26
      4  swift                    0x000000010704b621 cmark_strbuf__initbuf + 74160
      5  swift                    0x00000001064517ae abort + 14
      6  swift                    0x0000000106451791 __assert_rtn + 81
      7  swift                    0x0000000103f30ccf swift::ASTVisitor<(anonymous namespace)::ExprRewriter, swift::Expr*, void, void, void, void, void>::visit(swift::Expr*) + 25183
      8  swift                    0x0000000103f22595 (anonymous namespace)::ExprRewriter::walkToExprPost(swift::Expr*) + 21
      9  swift                    0x0000000103f263e3 (anonymous namespace)::ExprWalker::walkToExprPost(swift::Expr*) + 19
      10 swift                    0x00000001040d345b swift::Expr::walk(swift::ASTWalker&) + 123
      11 swift                    0x0000000103f1ef6b swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 475
      12 swift                    0x0000000103fcba6e swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 1070
      13 swift                    0x0000000103f4671d (anonymous namespace)::FailureDiagnosis::typeCheckChildIndependently(swift::Expr*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<TCCFlags, unsigned int>, swift::ExprTypeCheckListener*) + 1101
      14 swift                    0x0000000103f4d893 (anonymous namespace)::FailureDiagnosis::typeCheckArgumentChildIndependently(swift::Expr*, swift::Type, (anonymous namespace)::CalleeCandidateInfo const&, swift::OptionSet<TCCFlags, unsigned int>) + 1987
      15 swift                    0x0000000103f571d1 (anonymous namespace)::FailureDiagnosis::visitApplyExpr(swift::ApplyExpr*) + 913
      16 swift                    0x0000000103f41305 swift::ASTVisitor<(anonymous namespace)::FailureDiagnosis, bool, void, void, void, void, void>::visit(swift::Expr*) + 181
      17 swift                    0x0000000103f3abb8 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 104
      18 swift                    0x0000000103f40d38 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4056
      19 swift                    0x0000000103fc52b5 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 917
      20 swift                    0x0000000103fcb9d8 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 920
      21 swift                    0x0000000103f4671d (anonymous namespace)::FailureDiagnosis::typeCheckChildIndependently(swift::Expr*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<TCCFlags, unsigned int>, swift::ExprTypeCheckListener*) + 1101
      22 swift                    0x0000000103f433a7 swift::ASTVisitor<(anonymous namespace)::FailureDiagnosis, bool, void, void, void, void, void>::visit(swift::Expr*) + 8535
      23 swift                    0x0000000103f3abb8 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 104
      24 swift                    0x0000000103f40d38 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4056
      25 swift                    0x0000000103fc52b5 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 917
      26 swift                    0x0000000103fcb9d8 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 920
      27 swift                    0x0000000103f4671d (anonymous namespace)::FailureDiagnosis::typeCheckChildIndependently(swift::Expr*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<TCCFlags, unsigned int>, swift::ExprTypeCheckListener*) + 1101
      28 swift                    0x0000000103f4d893 (anonymous namespace)::FailureDiagnosis::typeCheckArgumentChildIndependently(swift::Expr*, swift::Type, (anonymous namespace)::CalleeCandidateInfo const&, swift::OptionSet<TCCFlags, unsigned int>) + 1987
      29 swift                    0x0000000103f571d1 (anonymous namespace)::FailureDiagnosis::visitApplyExpr(swift::ApplyExpr*) + 913
      30 swift                    0x0000000103f41305 swift::ASTVisitor<(anonymous namespace)::FailureDiagnosis, bool, void, void, void, void, void>::visit(swift::Expr*) + 181
      31 swift                    0x0000000103f3abb8 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 104
      32 swift                    0x0000000103f40d38 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4056
      33 swift                    0x0000000103fc52b5 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 917
      34 swift                    0x0000000103fcb9d8 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 920
      35 swift                    0x0000000103f4671d (anonymous namespace)::FailureDiagnosis::typeCheckChildIndependently(swift::Expr*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<TCCFlags, unsigned int>, swift::ExprTypeCheckListener*) + 1101
      36 swift                    0x0000000103f4deaa (anonymous namespace)::FailureDiagnosis::typeCheckArgumentChildIndependently(swift::Expr*, swift::Type, (anonymous namespace)::CalleeCandidateInfo const&, swift::OptionSet<TCCFlags, unsigned int>) + 3546
      37 swift                    0x0000000103f571d1 (anonymous namespace)::FailureDiagnosis::visitApplyExpr(swift::ApplyExpr*) + 913
      38 swift                    0x0000000103f41305 swift::ASTVisitor<(anonymous namespace)::FailureDiagnosis, bool, void, void, void, void, void>::visit(swift::Expr*) + 181
      39 swift                    0x0000000103f3abb8 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 104
      40 swift                    0x0000000103f40d38 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4056
      41 swift                    0x0000000103fc52b5 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 917
      42 swift                    0x0000000103fcb9d8 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 920
      43 swift                    0x0000000103fccd4f swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 367
      44 swift                    0x0000000103fccf4a swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 298
      45 swift                    0x0000000103fddec6 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 262
      46 swift                    0x0000000103fdddac swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 156
      47 swift                    0x0000000104000f8a swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1434
      48 swift                    0x0000000103c9dc0c swift::CompilerInstance::performSema() + 3916
      49 swift                    0x0000000103792171 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3185
      50 swift                    0x0000000103752320 main + 2544
      51 libdyld.dylib            0x00007fff8c2365ad start + 1
      52 libdyld.dylib            0x0000000000000029 start + 1943837309
      Stack dump:
      0.	Program arguments: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-08-18-a.xctoolchain/usr/bin/swift -frontend -c /Users/stefanu/Developer/sepro/Sources/Parser/AST.swift /Users/stefanu/Developer/sepro/Sources/Parser/CharacterSets.swift -primary-file /Users/stefanu/Developer/sepro/Sources/Parser/Grammar.swift /Users/stefanu/Developer/sepro/Sources/Parser/Lexer.swift /Users/stefanu/Developer/sepro/Sources/Parser/Operators.swift /Users/stefanu/Developer/sepro/Sources/Parser/Parser.swift -target x86_64-apple-macosx10.10 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -I /Users/stefanu/Developer/sepro/.build/debug -F /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -enable-testing -g -module-cache-path /Users/stefanu/Developer/sepro/.build/debug/ModuleCache -D SWIFT_PACKAGE -emit-module-doc-path /Users/stefanu/Developer/sepro/.build/debug/Parser.build/Grammar~partial.swiftdoc -Onone -parse-as-library -module-name Parser -emit-module-path /Users/stefanu/Developer/sepro/.build/debug/Parser.build/Grammar~partial.swiftmodule -emit-dependencies-path /Users/stefanu/Developer/sepro/.build/debug/Parser.build/Grammar.d -emit-reference-dependencies-path /Users/stefanu/Developer/sepro/.build/debug/Parser.build/Grammar.swiftdeps -num-threads 8 -o /Users/stefanu/Developer/sepro/.build/debug/Parser.build/Grammar.swift.o
      1.	While type-checking declaration 0x7fcafc83f9f8 at /Users/stefanu/Developer/sepro/Sources/Parser/Grammar.swift:94:1
      2.	While type-checking expression at [/Users/stefanu/Developer/sepro/Sources/Parser/Grammar.swift:95:9 - line:96:98] RangeText="target_type + option(op(".") *> %"slot") => { target in ModifierTarget(target.0, target.1) }
      		|| %"slot"                               => { symbol in ModifierTarget(TargetType.This, symbol)}"
      3.	While type-checking expression at [/Users/stefanu/Developer/sepro/Sources/Parser/Grammar.swift:95:9 - line:95:100] RangeText="target_type + option(op(".") *> %"slot") => { target in ModifierTarget(target.0, target.1) }"
      4.	While type-checking expression at [/Users/stefanu/Developer/sepro/Sources/Parser/Grammar.swift:95:53 - line:95:100] RangeText="{ target in ModifierTarget(target.0, target.1) }"
      5.	While type-checking expression at [/Users/stefanu/Developer/sepro/Sources/Parser/Grammar.swift:95:65 - line:95:98] RangeText="ModifierTarget(target.0, target.1)"
      6.	While type-checking expression at [/Users/stefanu/Developer/sepro/Sources/Parser/Grammar.swift:95:80 - line:95:87] RangeText="target.0"
      <unknown>:0: error: unable to execute command: Illegal instruction: 4
      <unknown>:0: error: compile command failed due to signal (use -v to see invocation)
      <unknown>:0: error: build had 1 command failures
      error: exit(1): /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-08-18-a.xctoolchain/usr/bin/swift-build-tool -f /Users/stefanu/Developer/sepro/.build/debug.yaml
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            Stiivi Stefan Urbanek
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: