@@ -23,7 +23,7 @@ import dotty.tools.dotc.ast.Trees
2323import dotty .tools .dotc .config .ScalaVersion
2424import dotty .tools .dotc .core .Flags .{FlagSet , Mutable }
2525import dotty .tools .dotc .core .SymDenotations .SymDenotation
26- import diagnostic .DocumentationLink .{DottyDocs , LanguageSpec , TourUrl }
26+ import diagnostic .DocumentationLink .{DottyDocs , FullUrl , LanguageSpec , TourUrl }
2727
2828import scala .util .control .NonFatal
2929
@@ -99,18 +99,13 @@ object messages {
9999 import ast .tpd
100100
101101 /** Helper methods for messages */
102- private def tryExpressionLinks = List (
103- LanguageSpec (suffix = " 06-expressions.html#try-expressions" )
104- )
102+ private def tryExpressionLinks = LanguageSpec (" 06-expressions.html#try-expressions" ) :: Nil
105103
106- private def implicitClassLinks = List (
107- TourUrl (" More information on implicit classes" , " core/implicit-classes.html" )
108- )
104+ private def implicitClassLinks = TourUrl (" core/implicit-classes.html" , " More information on implicit classes" ) :: Nil
109105
110- private def patternMatchingLinks = List (
111- LanguageSpec (suffix = " 08-pattern-matching.html" ),
112- DottyDocs (suffix = " reference/changed/pattern-matching.html" )
113- )
106+ private def patternMatchingLinks =
107+ LanguageSpec (" 08-pattern-matching.html" ) ::
108+ DottyDocs (" reference/changed/pattern-matching.html" ) :: Nil
114109
115110
116111 // Syntax Errors ---------------------------------------------------------- //
@@ -182,9 +177,7 @@ object messages {
182177 |use of the ${" with" } keyword. There are a few differences in
183178 |semantics between intersection types and using ` ${" with" }'. """
184179
185- override val links = List (
186- DottyDocs (suffix = " reference/intersection-types.html" )
187- )
180+ override val links = DottyDocs (" reference/intersection-types.html" ) :: Nil
188181 }
189182
190183 case class CaseClassMissingParamList (cdef : untpd.TypeDef )(implicit ctx : Context )
@@ -198,9 +191,7 @@ object messages {
198191 |have a singleton representation of ${cdef.name}, use a " ${" case object" }".
199192 |Or, add an explicit `()' as a parameter list to ${cdef.name}. """
200193
201- override val links = List (
202- LanguageSpec (suffix = " 05-classes-and-objects.html#case-classes" )
203- )
194+ override val links = LanguageSpec (" 05-classes-and-objects.html#case-classes" ) :: Nil
204195 }
205196
206197 case class AnonymousFunctionMissingParamType (param : untpd.ValDef ,
@@ -234,9 +225,7 @@ object messages {
234225 |
235226 | ${" val f: Seq[Int] => Option[List[Int]] = { case xs @ List(1, 2, 3) => Some(xs) }" } """
236227
237- override val links = List (
238- LanguageSpec (suffix = " 06-expressions.html#anonymous-functions" )
239- )
228+ override val links = LanguageSpec (" 06-expressions.html#anonymous-functions" ) :: Nil
240229 }
241230
242231 case class WildcardOnTypeArgumentNotAllowedOnNew ()(implicit ctx : Context )
@@ -441,9 +430,7 @@ object messages {
441430
442431 }
443432
444- override val links = List (
445- DottyDocs (suffix = " reference/trait-parameters.html" )
446- )
433+ override val links = DottyDocs (" reference/trait-parameters.html" ) :: Nil
447434 }
448435
449436 case class TopLevelImplicitClass (cdef : untpd.TypeDef )(implicit ctx : Context )
@@ -578,9 +565,7 @@ object messages {
578565 | """
579566 }
580567
581- override val links = List (
582- TourUrl (" More on String Interpolation" , " core/string-interpolation.html" )
583- )
568+ override val links = TourUrl (" core/string-interpolation.html" , " More on String Interpolation" ) :: Nil
584569 }
585570
586571 case class UnboundPlaceholderParameter ()(implicit ctx: Context )
@@ -915,9 +900,7 @@ object messages {
915900 | - null
916901 | """
917902
918- override val links = List (
919- LanguageSpec (suffix = " 01-lexical-syntax.html#literals" )
920- )
903+ override val links = LanguageSpec (suffix = " 01-lexical-syntax.html#literals" ) :: Nil
921904 }
922905
923906 case class PatternMatchExhaustivity (uncovered : String )(implicit ctx : Context )
@@ -1092,9 +1075,7 @@ object messages {
10921075 |
10931076 | ${" List[_]" }
10941077 | """
1095- override val links = List (
1096- DottyDocs (suffix = " reference/dropped/existential-types.html" )
1097- )
1078+ override val links = DottyDocs (" reference/dropped/existential-types.html" ) :: Nil
10981079 }
10991080
11001081 case class UnboundWildcardType ()(implicit ctx : Context )
@@ -1281,9 +1262,7 @@ object messages {
12811262 | (all other special characters)
12821263 |Operators starting with a letter have lowest precedence, followed by operators starting with `|`, etc.
12831264 | """ .stripMargin
1284- override val links = List (
1285- LanguageSpec (suffix = " 06-expressions.html#infix-operations" )
1286- )
1265+ override val links = LanguageSpec (" 06-expressions.html#infix-operations" ) :: Nil
12871266 }
12881267
12891268 case class CantInstantiateAbstractClassOrTrait (cls : Symbol , isTrait : Boolean )(implicit ctx : Context )
@@ -1758,9 +1737,7 @@ object messages {
17581737 |In this instance, the modifier combination is not supported """
17591738 }
17601739
1761- override val links = List (
1762- LanguageSpec (" Please see the official Scala Language Specification section on modifiers" ,
1763- " 05-classes-and-objects.html#modifiers" ))
1740+ override val links = LanguageSpec (" 05-classes-and-objects.html#modifiers" ) :: Nil
17641741 }
17651742
17661743 case class ImplicitFunctionTypeNeedsNonEmptyParameterList ()(implicit ctx : Context )
@@ -1779,9 +1756,7 @@ object messages {
17791756 |
17801757 | $code2""" .stripMargin
17811758 }
1782- override val links = List (
1783- DottyDocs (suffix = " reference/implicit-function-types.html" )
1784- )
1759+ override val links = DottyDocs (" reference/implicit-function-types.html" ) :: Nil
17851760 }
17861761
17871762 case class WrongNumberOfParameters (expected : Int )(implicit ctx : Context )
@@ -1805,9 +1780,7 @@ object messages {
18051780 val msg = " expected start of definition"
18061781 val explanation =
18071782 hl " you have to provide either ${" class" }, ${" trait" }, ${" object" }, or ${" enum" } definitions after qualifiers "
1808- override val links = List (
1809- LanguageSpec (suffix = " 09-top-level-definitions.html" )
1810- )
1783+ override val links = LanguageSpec (suffix = " 09-top-level-definitions.html" ) :: Nil
18111784 }
18121785
18131786 case class NoReturnFromInline (owner : Symbol )(implicit ctx : Context )
0 commit comments