Assertions on approximation of platform types to non-null types

- for most expressions (ExpressionCodegen.genQualified)
This commit is contained in:
Andrey Breslav
2014-10-05 22:18:15 +04:00
parent 3d5d3e00e3
commit f1c66fa6b0
11 changed files with 193 additions and 24 deletions
+13 -1
View File
@@ -102,4 +102,16 @@ val arr: Array<Bar> = javaArrayMethod() // assert value "is Bar[]"
`a++` stands for `a = a.inc()`, so
- check a to satisfy the `a.inc()` conditions for receiver
- check `a.inc()` result for assignability to `a`
- check `a.inc()` result for assignability to `a`
## Assertion Generation
Constructs in question: anything that provides an expected type, i.e.
- assignments
- parameter default values
- delegation by: supertypes and properties
- dereferencing: x.foo
- all kinds of calls (foo, foo(), x[], x foo y, x + y, x++, x += 3, for loop, multi-declarations, invoke-convention, ...)
- explicit expected type (foo: Bar)
- for booleans: if (foo), foo || bar, foo && bar (!foo is a call)
- argument of throw