Svetlana Isakova
b9f55f5070
test added
2013-09-17 16:09:27 +04:00
Svetlana Isakova
845b6f7d7e
fixed bug
...
NULL_FOR_NONNULL_TYPE can represent type mismatch error as well
(later the whole method 'makeTraceInterceptingTypeMismatch' should be removed)
2013-09-17 16:09:26 +04:00
Andrey Breslav
a9134f8eff
Do not allow inference of type arguments on the rhs if there's no information available
2013-09-13 22:41:06 +02:00
Andrey Breslav
5c86a5bd7c
Allow bare types on the right-hand side of as/as?/is/!is
2013-09-13 22:41:06 +02:00
Andrey Breslav
69cc11d035
Existing tests updated according to "'Else' is not required in 'when' if Unit is expected"
2013-09-13 22:05:37 +02:00
Andrey Breslav
c017858f77
'Else' is not required in 'when' if Unit is expected
2013-09-13 22:04:46 +02:00
Svetlana Isakova
298d344c31
check constants with Unit return type as usual
2013-09-13 16:04:17 +04:00
Svetlana Isakova
b6386e345c
added positioning for 'ILLEGAL_ESCAPE' error
2013-09-13 16:04:17 +04:00
Svetlana Isakova
96db2ecabd
added different errors instead of ERROR_COMPILE_TIME_VALUE with different text
...
check type for constants in DataFlowUtils
2013-09-13 16:04:17 +04:00
Svetlana Isakova
5f189a8c0f
KT-3833 Invoke method not working inside class object?
...
#KT-3833 Fixed
2013-09-13 16:04:17 +04:00
Evgeny Gerashchenko
e4d8e4d61b
Not ignoring other properties in scope.
...
First one (almost randomly) was chosen instead of ambiguity.
2013-09-12 14:58:58 +04:00
Nikolay Krasko
e4c1fe7c3a
Report unsupported annotations for local variables
2013-09-11 12:01:34 +04:00
Nikolay Krasko
08b8f56740
Fix rewrite for ANNOTATION slice (EA-49336)
2013-09-11 12:01:32 +04:00
Andrey Breslav
fca6182288
Fixed the case of "Any is/as List<*>" for erased cast diagnostic
2013-09-06 13:37:09 +04:00
Andrey Breslav
e3175c66e8
Fixing failed tests: do not report anything on casts that can never succeed
2013-09-05 15:03:37 +04:00
Andrey Breslav
e3079ac667
Erased casts supported
2013-09-05 14:17:33 +04:00
Andrey Breslav
a28d211442
'Cast can never succeed' diagnostics improved
2013-09-05 14:17:32 +04:00
Svetlana Isakova
a53eae79b5
bug fixed: analyze arguments in FREE expression position
2013-09-03 19:56:20 +04:00
Svetlana Isakova
b5e6568726
bug fixed: do not substitute type parameters twice
...
through final argument check
2013-09-03 19:50:00 +04:00
Svetlana Isakova
7fabfd8771
test data fixed
...
temporary
when ambiguity inner calls are not completed
2013-09-03 13:09:18 +04:00
Svetlana Isakova
79c18f1c56
test data fixed
...
temporary
2013-09-03 13:09:17 +04:00
Svetlana Isakova
efda014109
test data fixed
...
ignore error types in resolving constraints for generic functions
'if' is resolved as special function
2013-09-03 13:09:17 +04:00
Svetlana Isakova
335e0d7d1b
test data fixed
...
can't implicitly convert to Unit any more in 'if'
as 'if' is resolved as special function call 'fun IF<T>(T, T)'
2013-09-03 13:09:17 +04:00
Svetlana Isakova
c739632c57
report 'ambiguity' on reference, not on the whole expression
...
as other type inference errors
2013-09-03 13:09:15 +04:00
Svetlana Isakova
0084b68176
analyze incomplete 'in' expression
2013-09-03 13:09:14 +04:00
Svetlana Isakova
a493125a75
refactoring: fixes after review
...
rename, removed unnecessary methods, improved test
2013-09-03 13:09:11 +04:00
Svetlana Isakova
928133b69b
small fixes after review
2013-09-03 13:09:10 +04:00
Svetlana Isakova
fd5a2056c1
analyze labeled function literals as usual ones
...
(specially as function literals, not as other expressions)
2013-09-03 13:09:10 +04:00
Svetlana Isakova
8f29968183
test data updated
...
arguments analyzed even if there's type inference error
2013-09-03 13:09:09 +04:00
Svetlana Isakova
30b0a72c6b
analyze all arguments with unknown expected type
...
in the beginning of call resolution process
2013-09-03 13:09:07 +04:00
Svetlana Isakova
756cb3759b
fixed: use function placeholder when there is no declared value parameter list
...
(not when there is no value parameters)
2013-09-03 13:09:06 +04:00
Svetlana Isakova
dc51a2d238
analyze a lot of expressions in independent of context (expected type) mode
2013-09-03 13:09:05 +04:00
Svetlana Isakova
6429239f3f
rewrote analyzing expression with type rhs
...
removed unnecessary temporary trace (and so extra 'getType' for left expression)
2013-09-03 13:09:03 +04:00
Svetlana Isakova
7b04755a59
through completion phase result type of call should be updated
...
with respect to being selector in safe call expression
2013-09-03 13:09:02 +04:00
Svetlana Isakova
4621fe6dfa
resolve elvis operator as call
2013-09-03 13:09:02 +04:00
Svetlana Isakova
aba70e047d
resolve a!! as call
2013-09-02 23:18:46 +04:00
Svetlana Isakova
46cb6b3242
complete resolve for array access expression
2013-09-02 23:18:45 +04:00
Svetlana Isakova
e2f681c587
report type mismatch deeply on branches for if
...
in type argument inference case
2013-09-02 23:18:45 +04:00
Svetlana Isakova
99bb6f13b5
data flow info for arg may affect next argument's type for type argument inference case
2013-09-02 23:18:45 +04:00
Svetlana Isakova
27cff93ed8
use data flow info in constraint system
...
intersect data flow value possible types
add intersection type (or exact type for the most cases) as a lower bound to constraint system
always get common super type for intersection type as a result
(avoid returning it, even in error messages)
2013-09-02 23:18:45 +04:00
Svetlana Isakova
0609f61ee7
added test for nontrivial nested calls
2013-09-02 23:18:44 +04:00
Svetlana Isakova
0849798af0
report only 'The value is out of range'
...
not 'An integer literal does not conform to the expected type Int/Long'
2013-09-02 23:18:44 +04:00
Svetlana Isakova
f2746b835e
report ERROR_COMPILE_TIME_VALUE for constants instead of TYPE_MISMATCH
...
(functionality returned)
2013-09-02 23:18:44 +04:00
Svetlana Isakova
fccfa0051e
added DoubleValueTypeConstructor
...
no need to store exact value in IntegerValueTypeConstructor, it was removed
2013-09-02 23:18:43 +04:00
Svetlana Isakova
80eb45b793
process number value types properly in constraint system
...
the case when type parameter has number value types (constants) as lower bounds
should be handled specially, because upper bound for primitive number types is 'Number',
but by default we want Int (or Long)
2013-09-02 23:18:43 +04:00
Svetlana Isakova
0eed0c6c7f
extracted 'getResultingCall' method
...
rewrote 'getResultingType' in terms of it
2013-09-02 23:18:43 +04:00
Svetlana Isakova
2eadd5202d
check argument types through complete phase
...
with right data flow info
2013-09-02 23:18:42 +04:00
Mohammad Shamsi
32c34a3740
KT-3893 Fixed
...
- Added modifier check for parameters in constructors.
- Added modifier check for parameters in functions.
- Added modifier check for parameters in try/catch
2013-08-29 22:08:26 +08:00
Andrey Breslav
6cee65d74e
A test for nesting implicitly labeled calls
...
The actual error message should be "return not allowed", but due to a bug in label resolution it is "unresolved reference"
2013-08-22 17:13:08 +04:00
Andrey Breslav
55eb994502
KT-3919 Automatic labeling of lambdas by receiving functions
...
#KT-3919 Fixed
2013-08-22 14:27:01 +04:00