* otherwise
*/
public bool equals (TypeParameter param2) {
- /* only type parameters with the same parent are comparable */
- if (parent_symbol != param2.parent_symbol) {
- Report.error (source_reference, "internal error: comparing type parameters with different parents");
+ /* only type parameters with a common scope are comparable */
+ if (!owner.is_subscope_of (param2.owner) && !param2.owner.is_subscope_of (owner)) {
+ Report.error (source_reference, "internal error: comparing type parameters from different scopes");
return false;
}
- return name == param2.name;
+ return name == param2.name && parent_symbol == param2.parent_symbol;
}
}