Skip to content

Commit f87507a

Browse files
authored
Fix indentation
1 parent 1912e08 commit f87507a

File tree

1 file changed

+23
-28
lines changed

1 file changed

+23
-28
lines changed

docs/docs/reference/erased-terms.md

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,10 @@ object Test {
147147
Rules
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
157156
erased 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

183180
Note 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

188185
if `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

201197
Method 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

Comments
 (0)