@@ -147,11 +147,10 @@ object Test {
147147Rules
148148-----
149149
150- 1 ) The ` erased ` modifier can appear:
151-
152- * At the start of a parameter block of a method, function or class
153- * In a method definition
154- * In a ` val ` definition (but not ` lazy val ` or ` var ` )
150+ 1 . The ` erased ` modifier can appear:
151+ * At the start of a parameter block of a method, function or class
152+ * In a method definition
153+ * In a ` val ` definition (but not ` lazy val ` or ` var ` )
155154
156155``` scala
157156erased val x = ...
@@ -166,43 +165,39 @@ class K(erased x: Int) { ... }
166165```
167166
168167
169- 2 ) A reference to an ` erased ` definition can only be used
170-
171- * Inside the expression of argument to an ` erased ` parameter
172- * Inside the body of an ` erased ` ` val ` or ` def `
173-
168+ 2 . A reference to an ` erased ` definition can only be used
169+ * Inside the expression of argument to an ` erased ` parameter
170+ * Inside the body of an ` erased ` ` val ` or ` def `
174171
175- 3 ) Functions
176172
177- * ` (erased x1: T1, x2: T2, ..., xN: TN) => y : (erased T1, T2, ..., TN) => R `
178- * ` (implicit erased x1: T1, x2: T2, ..., xN: TN) => y : (implicit erased T1, T2, ..., TN) => R `
179- * ` implicit erased T1 => R <:< erased T1 => R `
180- * ` (implicit erased T1, T2) => R <:< (erased T1, T2) => R `
181- * ...
173+ 3 . Functions
174+ * ` (erased x1: T1, x2: T2, ..., xN: TN) => y : (erased T1, T2, ..., TN) => R `
175+ * ` (implicit erased x1: T1, x2: T2, ..., xN: TN) => y : (implicit erased T1, T2, ..., TN) => R `
176+ * ` implicit erased T1 => R <:< erased T1 => R `
177+ * ` (implicit erased T1, T2) => R <:< (erased T1, T2) => R `
178+ * ...
182179
183180Note that there is no subtype relation between ` erased T => R ` and ` T => R ` (or ` implicit erased T => R ` and ` implicit T => R ` )
184181
185182
186- 4 ) Eta expansion
183+ 4 . Eta expansion
187184
188185if ` def f(erased x: T): U ` then ` f: (erased T) => U ` .
189186
190187
191- 5 ) Erasure Semantics
188+ 5 . Erasure Semantics
189+ * All ` erased ` paramters are removed from the function
190+ * All argument to ` erased ` paramters are not passed to the function
191+ * All ` erased ` definitions are removed
192+ * All ` (erased T1, T2, ..., TN) => R ` and ` (implicit erased T1, T2, ..., TN) => R ` become ` () => R `
192193
193- * All ` erased ` paramters are removed from the function
194- * All argument to ` erased ` paramters are not passed to the function
195- * All ` erased ` definitions are removed
196- * All ` (erased T1, T2, ..., TN) => R ` and ` (implicit erased T1, T2, ..., TN) => R ` become ` () => R `
197194
198-
199- 6 ) Overloading
195+ 6 . Overloading
200196
201197Method with ` erased ` parameters will follow the normal overloading constraints after erasure.
202198
203199
204- 7 ) Overriding
205-
206- * Member definitions overidding each other must both be ` erased ` or not be ` erased `
207- * ` def foo(x: T): U ` cannot be overriden by ` def foo(erased x: T): U ` an viceversa
200+ 7 . Overriding
201+ * Member definitions overidding each other must both be ` erased ` or not be ` erased `
202+ * ` def foo(x: T): U ` cannot be overriden by ` def foo(erased x: T): U ` an viceversa
208203
0 commit comments