{"action":"closed","number":4096,"pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/4096","id":80407088,"html_url":"https://github.com/apple/swift/pull/4096","diff_url":"https://github.com/apple/swift/pull/4096.diff","patch_url":"https://github.com/apple/swift/pull/4096.patch","issue_url":"https://api.github.com/repos/apple/swift/issues/4096","number":4096,"state":"closed","locked":false,"title":"[swiftc (42 vs. 5156)] Add crasher in swift::lookupVisibleDecls(...)","user":{"login":"practicalswift","id":7826565,"avatar_url":"https://avatars.githubusercontent.com/u/7826565?v=3","gravatar_id":"","url":"https://api.github.com/users/practicalswift","html_url":"https://github.com/practicalswift","followers_url":"https://api.github.com/users/practicalswift/followers","following_url":"https://api.github.com/users/practicalswift/following{/other_user}","gists_url":"https://api.github.com/users/practicalswift/gists{/gist_id}","starred_url":"https://api.github.com/users/practicalswift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/practicalswift/subscriptions","organizations_url":"https://api.github.com/users/practicalswift/orgs","repos_url":"https://api.github.com/users/practicalswift/repos","events_url":"https://api.github.com/users/practicalswift/events{/privacy}","received_events_url":"https://api.github.com/users/practicalswift/received_events","type":"User","site_admin":false},"body":"Add test case for crash triggered in `swift::lookupVisibleDecls(...)`.\r\n\r\nCurrent number of unresolved compiler crashers: 42 (5156 resolved)\r\n\r\nAssertion failure in [`lib/AST/LookupVisibleDecls.cpp (line 566)`](https://github.com/apple/swift/blob/master/lib/AST/LookupVisibleDecls.cpp#L566):\r\n\r\n```\r\nAssertion `BaseTy.getPointer() != CurClass->getSuperclass().getPointer() && \"type is its own superclass\"' failed.\r\n\r\nWhen executing: void lookupVisibleMemberDeclsImpl(swift::Type, swift::VisibleDeclConsumer &, const swift::DeclContext *, (anonymous namespace)::LookupState, swift::DeclVisibilityKind, swift::LazyResolver *, VisitedSet &)\r\n```\r\n\r\nAssertion context:\r\n\r\n```\r\n    // If we have a class type, look into its superclass.\r\n    ClassDecl *CurClass = dyn_cast<ClassDecl>(CurNominal);\r\n\r\n    if (CurClass && CurClass->hasSuperclass()) {\r\n      assert(BaseTy.getPointer() != CurClass->getSuperclass().getPointer() &&\r\n             \"type is its own superclass\");\r\n      BaseTy = CurClass->getSuperclass();\r\n      Reason = getReasonForSuper(Reason);\r\n\r\n      bool InheritsSuperclassInitializers =\r\n          CurClass->inheritsSuperclassInitializers(TypeResolver);\r\n```\r\nStack trace:\r\n\r\n```\r\nswift: /path/to/swift/lib/AST/LookupVisibleDecls.cpp:566: void lookupVisibleMemberDeclsImpl(swift::Type, swift::VisibleDeclConsumer &, const swift::DeclContext *, (anonymous namespace)::LookupState, swift::DeclVisibilityKind, swift::LazyResolver *, VisitedSet &): Assertion `BaseTy.getPointer() != CurClass->getSuperclass().getPointer() && \"type is its own superclass\"' failed.\r\n10 swift           0x0000000001121734 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 1188\r\n11 swift           0x0000000000f16672 swift::TypeChecker::performTypoCorrection(swift::DeclContext*, swift::DeclRefKind, swift::Type, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>, swift::LookupResult&, unsigned int) + 290\r\n12 swift           0x0000000000ebc9ba swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*) + 4058\r\n14 swift           0x000000000109a4fb swift::Expr::walk(swift::ASTWalker&) + 27\r\n15 swift           0x0000000000ebd240 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>) + 224\r\n16 swift           0x0000000000ec448d swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 621\r\n17 swift           0x0000000000ec5640 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 352\r\n18 swift           0x0000000000ec585b swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267\r\n20 swift           0x0000000000ed1e5b swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 3851\r\n25 swift           0x0000000000f1665b swift::TypeChecker::performTypoCorrection(swift::DeclContext*, swift::DeclRefKind, swift::Type, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>, swift::LookupResult&, unsigned int) + 267\r\n27 swift           0x0000000000f8af6c swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 2364\r\n28 swift           0x0000000000f90a5e swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4078\r\n29 swift           0x0000000000ebd4b9 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>) + 857\r\n30 swift           0x0000000000ec448d swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 621\r\n31 swift           0x0000000000ec5640 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 352\r\n32 swift           0x0000000000ec585b swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267\r\n37 swift           0x0000000000ed74b6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150\r\n38 swift           0x0000000000efb3f2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026\r\n39 swift           0x0000000000c7b5c9 swift::CompilerInstance::performSema() + 3289\r\n41 swift           0x00000000007db4f7 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2887\r\n42 swift           0x00000000007a7328 main + 2872\r\nStack dump:\r\n0.\tProgram arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28389-swift-lookupvisibledecls.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28389-swift-lookupvisibledecls-e9a1a8.o\r\n1.\tWhile type-checking 'B' at validation-test/compiler_crashers/28389-swift-lookupvisibledecls.swift:10:1\r\n2.\tWhile type-checking expression at [validation-test/compiler_crashers/28389-swift-lookupvisibledecls.swift:10:16 - line:10:18] RangeText=\"A.b\"\r\n3.\tWhile type-checking expression at [validation-test/compiler_crashers/28389-swift-lookupvisibledecls.swift:10:36 - line:10:36] RangeText=\"V\"\r\n<unknown>:0: error: unable to execute command: Aborted\r\n<unknown>:0: error: compile command failed due to signal (use -v to see invocation)\r\n```","created_at":"2016-08-08T07:48:29Z","updated_at":"2016-08-08T11:58:01Z","closed_at":"2016-08-08T11:58:01Z","merged_at":"2016-08-08T11:58:01Z","merge_commit_sha":"50c1119247ddbccf170874a59899596773bd49da","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift/pulls/4096/commits","review_comments_url":"https://api.github.com/repos/apple/swift/pulls/4096/comments","review_comment_url":"https://api.github.com/repos/apple/swift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift/issues/4096/comments","statuses_url":"https://api.github.com/repos/apple/swift/statuses/27352a3a1f8c357479d77080412959c20e46196d","head":{"label":"practicalswift:swiftc-28389-swift-lookupvisibledecls","ref":"swiftc-28389-swift-lookupvisibledecls","sha":"27352a3a1f8c357479d77080412959c20e46196d","user":{"login":"practicalswift","id":7826565,"avatar_url":"https://avatars.githubusercontent.com/u/7826565?v=3","gravatar_id":"","url":"https://api.github.com/users/practicalswift","html_url":"https://github.com/practicalswift","followers_url":"https://api.github.com/users/practicalswift/followers","following_url":"https://api.github.com/users/practicalswift/following{/other_user}","gists_url":"https://api.github.com/users/practicalswift/gists{/gist_id}","starred_url":"https://api.github.com/users/practicalswift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/practicalswift/subscriptions","organizations_url":"https://api.github.com/users/practicalswift/orgs","repos_url":"https://api.github.com/users/practicalswift/repos","events_url":"https://api.github.com/users/practicalswift/events{/privacy}","received_events_url":"https://api.github.com/users/practicalswift/received_events","type":"User","site_admin":false},"repo":{"id":47491399,"name":"swift","full_name":"practicalswift/swift","owner":{"login":"practicalswift","id":7826565,"avatar_url":"https://avatars.githubusercontent.com/u/7826565?v=3","gravatar_id":"","url":"https://api.github.com/users/practicalswift","html_url":"https://github.com/practicalswift","followers_url":"https://api.github.com/users/practicalswift/followers","following_url":"https://api.github.com/users/practicalswift/following{/other_user}","gists_url":"https://api.github.com/users/practicalswift/gists{/gist_id}","starred_url":"https://api.github.com/users/practicalswift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/practicalswift/subscriptions","organizations_url":"https://api.github.com/users/practicalswift/orgs","repos_url":"https://api.github.com/users/practicalswift/repos","events_url":"https://api.github.com/users/practicalswift/events{/privacy}","received_events_url":"https://api.github.com/users/practicalswift/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/practicalswift/swift","description":"The Swift Programming Language","fork":true,"url":"https://api.github.com/repos/practicalswift/swift","forks_url":"https://api.github.com/repos/practicalswift/swift/forks","keys_url":"https://api.github.com/repos/practicalswift/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/practicalswift/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/practicalswift/swift/teams","hooks_url":"https://api.github.com/repos/practicalswift/swift/hooks","issue_events_url":"https://api.github.com/repos/practicalswift/swift/issues/events{/number}","events_url":"https://api.github.com/repos/practicalswift/swift/events","assignees_url":"https://api.github.com/repos/practicalswift/swift/assignees{/user}","branches_url":"https://api.github.com/repos/practicalswift/swift/branches{/branch}","tags_url":"https://api.github.com/repos/practicalswift/swift/tags","blobs_url":"https://api.github.com/repos/practicalswift/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/practicalswift/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/practicalswift/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/practicalswift/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/practicalswift/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/practicalswift/swift/languages","stargazers_url":"https://api.github.com/repos/practicalswift/swift/stargazers","contributors_url":"https://api.github.com/repos/practicalswift/swift/contributors","subscribers_url":"https://api.github.com/repos/practicalswift/swift/subscribers","subscription_url":"https://api.github.com/repos/practicalswift/swift/subscription","commits_url":"https://api.github.com/repos/practicalswift/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/practicalswift/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/practicalswift/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/practicalswift/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/practicalswift/swift/contents/{+path}","compare_url":"https://api.github.com/repos/practicalswift/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/practicalswift/swift/merges","archive_url":"https://api.github.com/repos/practicalswift/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/practicalswift/swift/downloads","issues_url":"https://api.github.com/repos/practicalswift/swift/issues{/number}","pulls_url":"https://api.github.com/repos/practicalswift/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/practicalswift/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/practicalswift/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/practicalswift/swift/labels{/name}","releases_url":"https://api.github.com/repos/practicalswift/swift/releases{/id}","deployments_url":"https://api.github.com/repos/practicalswift/swift/deployments","created_at":"2015-12-06T09:58:13Z","updated_at":"2016-04-08T19:23:07Z","pushed_at":"2016-08-08T07:47:55Z","git_url":"git://github.com/practicalswift/swift.git","ssh_url":"git@github.com:practicalswift/swift.git","clone_url":"https://github.com/practicalswift/swift.git","svn_url":"https://github.com/practicalswift/swift","homepage":"","size":110982,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"apple:master","ref":"master","sha":"441be7325e0300cdc28d68b7519d3cdf2ef4511e","user":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":44838949,"name":"swift","full_name":"apple/swift","owner":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apple/swift","description":"The Swift Programming Language","fork":false,"url":"https://api.github.com/repos/apple/swift","forks_url":"https://api.github.com/repos/apple/swift/forks","keys_url":"https://api.github.com/repos/apple/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift/teams","hooks_url":"https://api.github.com/repos/apple/swift/hooks","issue_events_url":"https://api.github.com/repos/apple/swift/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift/events","assignees_url":"https://api.github.com/repos/apple/swift/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift/tags","blobs_url":"https://api.github.com/repos/apple/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift/languages","stargazers_url":"https://api.github.com/repos/apple/swift/stargazers","contributors_url":"https://api.github.com/repos/apple/swift/contributors","subscribers_url":"https://api.github.com/repos/apple/swift/subscribers","subscription_url":"https://api.github.com/repos/apple/swift/subscription","commits_url":"https://api.github.com/repos/apple/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift/merges","archive_url":"https://api.github.com/repos/apple/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift/downloads","issues_url":"https://api.github.com/repos/apple/swift/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift/releases{/id}","deployments_url":"https://api.github.com/repos/apple/swift/deployments","created_at":"2015-10-23T21:15:07Z","updated_at":"2016-08-08T10:23:57Z","pushed_at":"2016-08-08T11:58:01Z","git_url":"git://github.com/apple/swift.git","ssh_url":"git@github.com:apple/swift.git","clone_url":"https://github.com/apple/swift.git","svn_url":"https://github.com/apple/swift","homepage":"https://swift.org/","size":171808,"stargazers_count":33008,"watchers_count":33008,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4621,"mirror_url":null,"open_issues_count":94,"forks":4621,"open_issues":94,"watchers":33008,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/4096"},"html":{"href":"https://github.com/apple/swift/pull/4096"},"issue":{"href":"https://api.github.com/repos/apple/swift/issues/4096"},"comments":{"href":"https://api.github.com/repos/apple/swift/issues/4096/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift/pulls/4096/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift/pulls/4096/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift/statuses/27352a3a1f8c357479d77080412959c20e46196d"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"practicalswift","id":7826565,"avatar_url":"https://avatars.githubusercontent.com/u/7826565?v=3","gravatar_id":"","url":"https://api.github.com/users/practicalswift","html_url":"https://github.com/practicalswift","followers_url":"https://api.github.com/users/practicalswift/followers","following_url":"https://api.github.com/users/practicalswift/following{/other_user}","gists_url":"https://api.github.com/users/practicalswift/gists{/gist_id}","starred_url":"https://api.github.com/users/practicalswift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/practicalswift/subscriptions","organizations_url":"https://api.github.com/users/practicalswift/orgs","repos_url":"https://api.github.com/users/practicalswift/repos","events_url":"https://api.github.com/users/practicalswift/events{/privacy}","received_events_url":"https://api.github.com/users/practicalswift/received_events","type":"User","site_admin":false},"comments":2,"review_comments":0,"commits":1,"additions":10,"deletions":0,"changed_files":1}}
{"actor":{"display_login":"practicalswift"}}