@@ -69,7 +69,7 @@ is equivalent to
69
69
Map { type Map$K <: AnyRef; type Map$V = Int }
70
70
71
71
72
- Type parameters in the Encodings
72
+ Type parameters in the encodings
73
73
--------------------------------
74
74
75
75
The notion of type parameters makes sense even for encoded types,
@@ -191,7 +191,7 @@ We expand this to
191
191
type Rep <: Lambda1
192
192
193
193
The type parameters of ` Rep ` are the type parameters of its upper bound, so
194
- ` Rep ` is a uniary type constructor.
194
+ ` Rep ` is a unary type constructor.
195
195
196
196
More generally, a higher-kinded type declaration
197
197
@@ -217,8 +217,8 @@ would expand to
217
217
Rep { type Arg1 = String } # Apply
218
218
219
219
If we instantiate the higher-kinded type with a concrete type constructor (i.e. a parameterized
220
- trait or class, we have to do one extra adaptation to make it work. The parameterized trait
221
- or class has to be eta-expansed so that it comforms to the ` Lambda ` bound. For instance,
220
+ trait or class) , we have to do one extra adaptation to make it work. The parameterized trait
221
+ or class has to be eta-expanded so that it comforms to the ` Lambda ` bound. For instance,
222
222
223
223
type Rep = Set
224
224
@@ -296,7 +296,7 @@ Roughly, `#` was meant to encode Java's inner classes. In Java, given the classe
296
296
297
297
The types ` Outer#Inner ` , ` Sub1#Inner ` and ` Sub2#Inner ` would all exist and be
298
298
regarded as equal to each other. But if ` Outer ` had abstract type members this would
299
- not work, since that type member could be instantiated differently in ` Sub1 ` and ` Sub2 ` .
299
+ not work, since an abstract type member could be instantiated differently in ` Sub1 ` and ` Sub2 ` .
300
300
Assuming that ` Sub1#Inner = Sub2#Inner ` could then lead to a soundness hole. To avoid soundness
301
301
problems, the types in ` X#Y ` were restricted so that ` Y ` was (an alias of) a class type and
302
302
` X ` was (an alias of) a class type with no abstract type members.
@@ -306,13 +306,13 @@ are more careful with the subtyping rules. Specifically:
306
306
307
307
A # X <: B # X
308
308
309
- if either ` A = B ` , or the following three conditions hold:
309
+ if either ` A =:= B ` (i.e. ` A <: B ` and ` B <: A ` ) , or the following three conditions hold:
310
310
311
311
1 . ` X ` is (an alias of) a class type,
312
312
2 . ` B ` is (an alias of) a class type without abstract type members.
313
313
3 . ` A <: B ` .
314
314
315
- In essence, we allow abstract types ` X ` , ` Y ` in a project ` X#Y ` but we prevent in this
315
+ In essence, we allow abstract types ` X ` , ` Y ` in a projection ` X#Y ` but we prevent in this
316
316
case hiding conflicting type information in a subtype widening.
317
317
318
318
It would be good to study these rules formally, trying to verify their soundness.
0 commit comments