File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -762,8 +762,10 @@ object RefChecks {
762
762
*/
763
763
def hasMatchingSym (inclazz : Symbol , member : Symbol ): Boolean = {
764
764
765
- def isSignatureMatch (sym : Symbol ) = ! sym.isTerm ||
766
- clazz.thisType.memberInfo(sym).matchesLoosely(member.info)
765
+ def isSignatureMatch (sym : Symbol ) = sym.isType || {
766
+ val self = clazz.thisType
767
+ sym.asSeenFrom(self).matches(member.asSeenFrom(self))
768
+ }
767
769
768
770
/* The rules for accessing members which have an access boundary are more
769
771
* restrictive in java than scala. Since java has no concept of package nesting,
Original file line number Diff line number Diff line change
1
+ class A {
2
+ def foo [T <: Cloneable ](x : T ): Unit = {}
3
+ }
4
+ class B extends A {
5
+ override def foo [T <: Serializable ](x : T ): Unit = {} // error: method foo has a different signature than the overridden declaration
6
+ }
You can’t perform that action at this time.
0 commit comments