Defining flexible type semantic equality through subtyping

This commit is contained in:
Andrey Breslav
2014-10-14 08:07:55 +04:00
parent f41a8d2c00
commit 3453809b4b
6 changed files with 41 additions and 4 deletions
+6
View File
@@ -34,6 +34,12 @@ Least Upper Bound (aka "common supertype"):
* `lub[(A..B), (C..D)] = (lub[A, C], lub[B, D])
Type equivalence (aka `JetTypeChecker.DEFAULT.equalTypes()`):
`T1 ~~ T2 <=> T1 <: T2 && T2 <: T1`
NOTE: This relation is NOT transitive: `T?` ~~ (T..T?)` and `(T..T?) ~~ T`, but `T? !~ T`
## Loading Java Types