From b7b84dd43962487277ca2a979cec30584c3e5f20 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 30 May 2017 13:48:53 +0200 Subject: [PATCH] Add references to issues --- docs/docs/reference/adts.md | 7 +++---- docs/docs/reference/auto-parameter-tupling.md | 4 ++-- docs/docs/reference/changed/implicit-conversions.md | 3 ++- docs/docs/reference/changed/structural-types.md | 6 +++++- docs/docs/reference/desugarEnums.md | 4 ++-- docs/docs/reference/enums.md | 12 ++++++++---- docs/docs/reference/implicit-by-name-parameters.md | 4 ++++ docs/docs/reference/implicit-function-types.md | 4 ++++ docs/docs/reference/inline.md | 6 +++++- docs/docs/reference/multiversal-equality.md | 6 +++++- docs/docs/reference/trait-parameters.md | 2 ++ 11 files changed, 42 insertions(+), 16 deletions(-) diff --git a/docs/docs/reference/adts.md b/docs/docs/reference/adts.md index 486774e9997a..4f848d7a6b24 100644 --- a/docs/docs/reference/adts.md +++ b/docs/docs/reference/adts.md @@ -96,7 +96,7 @@ enum Color(val rgb: Int) { } ``` -## Syntax of Enums +### Syntax of Enums Changes to the syntax fall in two categories: enum classes and cases inside enums. The changes are specified below as deltas with respect to the Scala syntax given [here](https://github.com/lampepfl/dotty/blob/master/docs/docs/internals/syntax.md) @@ -116,7 +116,6 @@ The changes are specified below as deltas with respect to the Scala syntax given ClsParamClauses TemplateOpt TemplateStat ::= ... | EnumCaseStat +### Reference - - - +For more info, see [Issue #1970](https://github.com/lampepfl/dotty/issues/1970). diff --git a/docs/docs/reference/auto-parameter-tupling.md b/docs/docs/reference/auto-parameter-tupling.md index 910d13424c7e..d8298661c6ce 100644 --- a/docs/docs/reference/auto-parameter-tupling.md +++ b/docs/docs/reference/auto-parameter-tupling.md @@ -28,6 +28,6 @@ Generally, a function value with `n > 1` parameters is converted to a pattern-matching closure using `case` if the expected type is a unary function type of the form `((T_1, ..., T_n)) => U`. +### Reference - - +For more info, see [Issue #897](https://github.com/lampepfl/dotty/issues/897). diff --git a/docs/docs/reference/changed/implicit-conversions.md b/docs/docs/reference/changed/implicit-conversions.md index 72a386eba468..7264c9a628a8 100644 --- a/docs/docs/reference/changed/implicit-conversions.md +++ b/docs/docs/reference/changed/implicit-conversions.md @@ -43,6 +43,7 @@ is no longer legal and has to be rwritten to val x: B = a // OK } +### Reference - +For more info, see [PR #2065](https://github.com/lampepfl/dotty/pull/2065). diff --git a/docs/docs/reference/changed/structural-types.md b/docs/docs/reference/changed/structural-types.md index 95124d030743..76ab953eea07 100644 --- a/docs/docs/reference/changed/structural-types.md +++ b/docs/docs/reference/changed/structural-types.md @@ -102,7 +102,7 @@ the cast lies about the structure of the record, the corresponding likely be part if a database access layer which would ensure its correctness. -## Notes: +### Notes: 1. The scheme does not handle polymorphic methods in structural refinements. Such polymorphic methods are currently flagged as @@ -127,3 +127,7 @@ differences. takes class tags indicating the method's formal parameter types as additional argument. `Dynamic` comes with `applyDynamic` and `updateDynamic` methods, which take actual argument values. + +### Reference + +For more info, see [Issue #1886](https://github.com/lampepfl/dotty/issues/1886). \ No newline at end of file diff --git a/docs/docs/reference/desugarEnums.md b/docs/docs/reference/desugarEnums.md index d3c9208c47a8..86a4ed27010b 100644 --- a/docs/docs/reference/desugarEnums.md +++ b/docs/docs/reference/desugarEnums.md @@ -138,7 +138,7 @@ comma separated simple cases into a sequence of cases. Any modifiers or annotations on the original case extend to all expanded cases. -## Equality +### Equality An `enum` type contains a `scala.Eq` instance that restricts values of the `enum` type to be compared only to other values of the same enum type. Furtermore, generic @@ -147,7 +147,7 @@ be compared only to other values of the same enum type. Furtermore, generic implicit def eqOption[T, U](implicit ev1: Eq[T, U]): Eq[Option[T], Option[U]] = Eq -## Translation of Enumerations +### Translation of Enumerations Non-generic enum classes `E` that define one or more singleton cases are called _enumerations_. Companion objects of enumerations define diff --git a/docs/docs/reference/enums.md b/docs/docs/reference/enums.md index 795c0d6210a1..93a7eae2aebd 100644 --- a/docs/docs/reference/enums.md +++ b/docs/docs/reference/enums.md @@ -26,7 +26,7 @@ object Color { } ``` -## Parameterized enums +### Parameterized enums Enum classes can be parameterized. @@ -41,7 +41,7 @@ enum Color(val rgb: Int) { As the example shows, you can define the parameter value by using an explicit extends clause. -## Methods defined for enums +### Methods defined for enums The values of an enum correspond to unique integers. The integer associated with an enum value is returned by its `enumTag` method: @@ -67,7 +67,7 @@ scala> Color.enumValues val res3: collection.Iterable[Color] = MapLike(Red, Green, Blue) ``` -## User-defined members of enums +### User-defined members of enums It is possible to add your own definitions to an enum class or its companion object. To make clear what goes where you need to use the @@ -101,7 +101,7 @@ object Planet { } ``` -## Implementation +### Implementation Enum classes are represented as `sealed` classes that extend the `scala.Enum` trait. This trait defines a single method, `enumTag`: @@ -137,3 +137,7 @@ definition of value `Color.Red` above would expand to: ```scala val Red: Color = $new(0, "Red") ``` + +### Reference + +For more info, see [Issue #1970](https://github.com/lampepfl/dotty/issues/1970). diff --git a/docs/docs/reference/implicit-by-name-parameters.md b/docs/docs/reference/implicit-by-name-parameters.md index af341fb982ee..c207d71fcffc 100644 --- a/docs/docs/reference/implicit-by-name-parameters.md +++ b/docs/docs/reference/implicit-by-name-parameters.md @@ -62,3 +62,7 @@ val s = implicitly[Test.Codec[Option[Int]]]( ``` No lazy val was generated because the synthesized argument is not recursive. + +### Reference + +For more info, see [Issue #1998](https://github.com/lampepfl/dotty/issues/1998.) \ No newline at end of file diff --git a/docs/docs/reference/implicit-function-types.md b/docs/docs/reference/implicit-function-types.md index 0f9b9b42c672..9ce9762a838f 100644 --- a/docs/docs/reference/implicit-function-types.md +++ b/docs/docs/reference/implicit-function-types.md @@ -97,3 +97,7 @@ With that setup, the table construction code above compiles and expands to: cell("bottom right")($r) }($t) } + +### Reference + +For more info, see the [blog article](https://www.scala-lang.org/blog/2016/12/07/implicit-function-types.html). \ No newline at end of file diff --git a/docs/docs/reference/inline.md b/docs/docs/reference/inline.md index 9515529f117e..13bb9f1c8998 100644 --- a/docs/docs/reference/inline.md +++ b/docs/docs/reference/inline.md @@ -109,7 +109,7 @@ overhead: } } -## Relationship to `@inline`. +### Relationship to `@inline`. Existing Scala defines a `@inline` annotation which is used as a hint for the backend to inline. For most purposes, this annotation is @@ -125,6 +125,10 @@ it in backticks, i.e. @`inline` def ... +### Reference + +For more info, see [PR #1492](https://github.com/lampepfl/dotty/pull/1492) and +[Scala SIP 28](http://docs.scala-lang.org/sips/pending/inline-meta.html) diff --git a/docs/docs/reference/multiversal-equality.md b/docs/docs/reference/multiversal-equality.md index 5f2cdbca9752..c330d567e573 100644 --- a/docs/docs/reference/multiversal-equality.md +++ b/docs/docs/reference/multiversal-equality.md @@ -94,4 +94,8 @@ The precise rules for equality checking are as follows. not eligible is successful. More on multiversal equality is found in a [blog post] -and a [Github issue]. \ No newline at end of file +and a [Github issue]. + +### Reference + +For more info, see [Issue #1247](https://github.com/lampepfl/dotty/issues/1247). \ No newline at end of file diff --git a/docs/docs/reference/trait-parameters.md b/docs/docs/reference/trait-parameters.md index 62415e57f800..050bb515cab9 100644 --- a/docs/docs/reference/trait-parameters.md +++ b/docs/docs/reference/trait-parameters.md @@ -55,4 +55,6 @@ The correct way to write `E` is to extend both `Greeting` and class E extends Greeting("Bob") with FormalGreeting ``` +### Reference +For more info, see [Scala SIP 25](http://docs.scala-lang.org/sips/pending/trait-parameters.html). \ No newline at end of file