File tree 1 file changed +18
-9
lines changed
compiler/src/dotty/tools/dotc/reporting/diagnostic 1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -972,25 +972,34 @@ object messages {
972
972
val kind = " Syntax"
973
973
val msg = hl """ Expected an additional member selection after the keyword ${" this" }"""
974
974
975
+ val contextCode =
976
+ """ trait Outer {
977
+ | val member: Int
978
+ | type Member
979
+ | trait Inner {
980
+ | ...
981
+ | }
982
+ | }"""
983
+
975
984
val importCode =
976
- """ import MyClass.this.member
977
- |// ^^^^^^^
978
- """
985
+ """ import Outer.this.member
986
+ | // ^^^^^^^"""
979
987
980
988
val typeCode =
981
- """ type T = MyClass.this.Member
982
- |// ^^^^^^^
983
- """
989
+ """ type T = Outer.this.Member
990
+ | // ^^^^^^^"""
984
991
985
992
val explanation =
986
993
hl """ |Paths of imports and type selections must not end with the keyword ${" this" }.
987
994
|
988
- |Maybe you forgot to select a member of ${" this" }?
995
+ |Maybe you forgot to select a member of ${" this" }? As an example, in the
996
+ |following context:
997
+ | ${contextCode}
989
998
|
990
- |- Example for a valid import expression using a path
999
+ |- this is a valid import expression using a path
991
1000
| ${importCode}
992
1001
|
993
- |- Example for a valid type using a path
1002
+ |- this is a valid type using a path
994
1003
| ${typeCode}
995
1004
| """
996
1005
}
You can’t perform that action at this time.
0 commit comments