[SR-4986] Overriding of a method with a constrained generic placeholder is incorrectly permitted #47563
Labels
accepts invalid
Bug: Accepts invalid
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
Environment
Apple Swift version 3.1 (swiftlang-802.0.53 clang-802.0.42)
Apple Swift version 4.0-dev (LLVM 4a2b8e688d, Clang 20de1703ca, Swift aa5754b)
Additional Detail from JIRA
md5: 830bfba804646fa9111fcb97df051aca
duplicates:
Issue Description:
The following compiles:
This shouldn't compile, because you should not be able to override the method
eat<T : Food>(_: T)
witheat<T : Meat>(_: T)
, asMeat
is a subtype ofFood
.Same goes for subclasses:
The text was updated successfully, but these errors were encountered: