@@ -13,14 +13,14 @@ To get a feel of how it works, we first show several examples below.
13
13
14
14
Given the following code snippet:
15
15
16
- ``` Scala
16
+ ``` scala
17
17
abstract class AbstractFile {
18
18
def name : String
19
19
val extension : String = name.substring(4 )
20
20
}
21
21
22
22
class RemoteFile (url : String ) extends AbstractFile {
23
- val localFile : String = url.hashCode + " .tmp" // error: usge of `localFile` before it's initialized
23
+ val localFile : String = s " ${ url.## } .tmp " // error: usage of `localFile` before it's initialized
24
24
def name : String = localFile
25
25
}
26
26
```
@@ -227,14 +227,14 @@ and avoids accidental violation of contracts across library versions.
227
227
228
228
We impose the following rules to enforce modularity:
229
229
230
- 4 . A class or trait that may be extended in another project should not
230
+ 1 . A class or trait that may be extended in another project should not
231
231
call virtual methods on ` this ` in its template/mixin evaluation,
232
232
directly or indirectly.
233
233
234
- 5 . The method call ` o.m(args) ` is forbidden if ` o ` is not transitively
234
+ 2 . The method call ` o.m(args) ` is forbidden if ` o ` is not transitively
235
235
initialized and the target of ` m ` is defined in an external project.
236
236
237
- 6 . The expression ` new p.C(args) ` is forbidden, if ` p ` is not transitively
237
+ 3 . The expression ` new p.C(args) ` is forbidden, if ` p ` is not transitively
238
238
initialized and ` C ` is defined in an external project.
239
239
240
240
Theoretically, we may analyze across project boundaries based on tasty. However,
@@ -262,7 +262,7 @@ Potentials (π) represent values that are possibly under initialization.
262
262
- ` π.super[D] ` : essentially the object π, used for virtual method resolution
263
263
- ` Cold ` : an object with unknown initialization status
264
264
- ` Fun(Π, Φ) ` : a function, when called produce effects Φ and return potentials Π.
265
- - ` Outer(C, π) ` : the potential of ` this ` for the enclosing class of ` C ` when ` C.this ` is ` π` .
265
+ - ` Outer(C, π) ` : the potential of ` this ` for the enclosing class of ` C ` when ` C.this ` is ` π ` .
266
266
267
267
Effects are triggered from potentials:
268
268
0 commit comments