Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/Sema/TypeCheckDeclObjC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2542,6 +2542,9 @@ namespace {
auto opposite = (*this)(rightDecl, leftDecl);
if (normal != opposite)
return normal;

leftContext = leftContext->getParent();
rightContext = rightContext->getParent();
}

// Final tiebreaker: Kind
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Foundation

extension EmitTest {
@objc static func emit(_ number : Int) -> Int {
// expected-note@-1 {{'emit' previously declared here}}
return 0
}
}
13 changes: 13 additions & 0 deletions test/multifile/objc_selector_conflict_multifile.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// RUN: %target-typecheck-verify-swift %S/Inputs/objc_selector_conflict_multifile_other.swift
// REQUIRES: objc_interop

import Foundation

class EmitTest {}

extension EmitTest {
@objc static func emit(_ string : String) -> String {
// expected-error@-1 {{method 'emit' with Objective-C selector 'emit:' conflicts with previous declaration with the same Objective-C selector}}
return ""
}
}