You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SR-4206 Override checking does not properly enforce requirements
relates to:
SR-4206 Override checking does not properly enforce requirements
Issue Description:
Overloading a method in a derived class that is the same type of signature from a base class with different generic constraints causes the compiler to think they are the same signature. I would expect overloads to be able to be created in the derived class with the same signature and different generic constraints.
protocolP {}
classBase {
funcf<T>(_type: T.Type) {}
}
classDerived : Base {
overridefuncf<T>(_type: T.Type) {}
// 'f' has already been overridenfuncf<T>(_type: T.Type) whereT : P {}
}
The text was updated successfully, but these errors were encountered:
It's the exact bug you related this one to (we're not comparing the generic signatures at all, so if constraints are too narrow we get a miscompile; if they're too broad we get false positives like this example)
Additional Detail from JIRA
md5: 0cbd26e948dad416f341c710f7c17100
duplicates:
relates to:
Issue Description:
Overloading a method in a derived class that is the same type of signature from a base class with different generic constraints causes the compiler to think they are the same signature. I would expect overloads to be able to be created in the derived class with the same signature and different generic constraints.
The text was updated successfully, but these errors were encountered: