panic("method with type parameters")
}
- // If the methods have type parameters we don't care whether they
- // are the same or not, as long as they match up. Use unification
- // to see if they can be made to match.
- // TODO(gri) is this always correct? what about type bounds?
- // (Alternative is to rename/subst type parameters and compare.)
- u := newUnifier(true)
- u.x.init(ftyp.TypeParams().list())
- if !u.unify(ftyp, mtyp) {
+ if !Identical(ftyp, mtyp) {
return m, f
}
}
panic("method with type parameters")
}
- // If the methods have type parameters we don't care whether they
- // are the same or not, as long as they match up. Use unification
- // to see if they can be made to match.
- // TODO(gri) is this always correct? what about type bounds?
- // (Alternative is to rename/subst type parameters and compare.)
- u := newUnifier(true)
- if ftyp.TypeParams().Len() > 0 {
- // We reach here only if we accept method type parameters.
- // In this case, unification must consider any receiver
- // and method type parameters as "free" type parameters.
- assert(acceptMethodTypeParams)
- // We don't have a test case for this at the moment since
- // we can't parse method type parameters. Keeping the
- // unimplemented call so that we test this code if we
- // enable method type parameters.
- unimplemented()
- u.x.init(append(ftyp.RecvTypeParams().list(), ftyp.TypeParams().list()...))
- } else {
- u.x.init(ftyp.RecvTypeParams().list())
- }
- if !u.unify(ftyp, mtyp) {
+ if !Identical(ftyp, mtyp) {
return m, f
}
}
panic("method with type parameters")
}
- // If the methods have type parameters we don't care whether they
- // are the same or not, as long as they match up. Use unification
- // to see if they can be made to match.
- // TODO(gri) is this always correct? what about type bounds?
- // (Alternative is to rename/subst type parameters and compare.)
- u := newUnifier(true)
- u.x.init(ftyp.TypeParams().list())
- if !u.unify(ftyp, mtyp) {
+ if !Identical(ftyp, mtyp) {
return m, f
}
}
panic("method with type parameters")
}
- // If the methods have type parameters we don't care whether they
- // are the same or not, as long as they match up. Use unification
- // to see if they can be made to match.
- // TODO(gri) is this always correct? what about type bounds?
- // (Alternative is to rename/subst type parameters and compare.)
- u := newUnifier(true)
- u.x.init(ftyp.RecvTypeParams().list())
- if !u.unify(ftyp, mtyp) {
+ if !Identical(ftyp, mtyp) {
return m, f
}
}