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._
20792079 case MethodNotAMethodMatch =>
20802080 " neither has parameters."
20812081 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"
20862092 }
20872093 }
20882094 else " "
Original file line number Diff line number Diff line change 55 | def f(): Int in class A at line 3 and
66 | def g(): Int in class B at line 5
77 | 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