File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
compiler/src/dotty/tools/dotc/reporting Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -2079,10 +2079,16 @@ import transform.SymUtils._
2079
2079
case MethodNotAMethodMatch =>
2080
2080
" neither has parameters."
2081
2081
case FullMatch =>
2082
- i """ have the same $nameAnd type after erasure.
2083
- |
2084
- |Consider adding a @targetName annotation to one of the conflicting definitions
2085
- |for disambiguation. """
2082
+ val hint =
2083
+ if ! decl.hasAnnotation(defn.TargetNameAnnot )
2084
+ && ! previousDecl.hasAnnotation(defn.TargetNameAnnot )
2085
+ then
2086
+ i """
2087
+ |
2088
+ |Consider adding a @targetName annotation to one of the conflicting definitions
2089
+ |for disambiguation. """
2090
+ else " "
2091
+ i " have the same $nameAnd type after erasure. $hint"
2086
2092
}
2087
2093
}
2088
2094
else " "
Original file line number Diff line number Diff line change 5
5
| def f(): Int in class A at line 3 and
6
6
| def g(): Int in class B at line 5
7
7
| have the same name and type after erasure.
8
- |
9
- | Consider adding a @targetName annotation to one of the conflicting definitions
10
- | for disambiguation.
You can’t perform that action at this time.
0 commit comments