Dmitry Savvinov
447c127036
Fix unsound smartcast from loop condition on assigned vars
...
^KT-22379 Fixed
2018-08-09 19:56:23 +03:00
Dmitry Savvinov
952f67dafc
Fix bogus smartcast on enum entry members
...
Previously, enum entries were treated by the data-flow subsystem similar
to other class/singletons. As a consequence, calls like
'Enum.ENTRY.property' had IdentifierInfo of 'property'.
However, specially for enum entries, descriptor of 'property' is one and
the same for all entries. It means that from the data-flow point of
view, 'Enum.ONE.property' and 'Enum.TWO.property' are *one and the same
data-flow values*.
It could obviously lead to some bogus smartcasts, so this commit
introduces separate IdentifierInfo.EnumEntry and uses it to build proper
qualified values.
^KT-20772 Fixed
2018-08-08 12:48:56 +03:00
Dmitry Petrov
5767f84c0e
Restrict retention for annotations with target EXPRESSION
...
#KT-13762 Fixed
2018-07-18 14:21:03 +03:00
Dmitry Savvinov
70714cb71e
Deprecate smartcasts on local delegated properties
...
^KT-22517 Fixed
2018-06-21 13:36:43 +03:00
Mikhail Zarechenskiy
3318549622
[NI] Fix smartcasts computation for dot-qualifier expressions
2018-04-16 18:13:12 +03:00
Dmitry Savvinov
33f9576dd1
[NI] Turn off KnownTypeParameterSubstitutor for NI
...
The main consequence of it is that TYPE_MISMATCH range for control
structures became wider.
Also, for extra safety, don't change behaviour of OI.
2017-12-07 14:05:42 +03:00
Dmitry Savvinov
15a595749b
[NI] Weird testdata change after fixes in ErrorTypes
...
The issue here is that OI infers correct types for (k, v) destructing
declaration, while NI infers errors for them. That happens because NI
resolves iterator() on nullable 'm', but rightfully reports it as
unsuccessful, while OI somehow manages to resolve it to success (and
thus getting nice expected type, allowing destructing declaration to be
resolved in a proper types).
2017-12-07 12:49:56 +03:00
Dmitry Savvinov
ea72c76a37
[NI] Testdata changes after fixes in error types
2017-12-07 12:49:56 +03:00
Dmitry Savvinov
816d89e393
[NI] Improved testdata after changes in applicabilities
...
This commits introduces testdata changes, where NI behaviour strictly
improved, after several previous fixes.
For some tests, just WITH_NEW_INFERENCE directive was added. It
indicates, that some of previous commits first introduced error in that
test, and then some other commit fixed it (netting no overall testdata
change). It is preferrably to keep those annotations until we will
migrate to NI completely, to prevent unexpected regressions.
2017-12-07 12:49:56 +03:00
Mikhail Zarechenskiy
1d736f59b6
[NI] Refine nullability for CST of types with undefined nullability
2017-12-06 18:36:20 +03:00
Mikhail Zarechenskiy
328c67b9e8
Add separate diagnostic renderer results for tests with NI
2017-11-29 02:54:30 +03:00
Mikhail Zarechenskiy
8757298994
Add diagnostics to test data from NI
2017-11-29 02:54:26 +03:00
Mikhail Zarechenskiy
a71238bf94
Place !WITH_NEW_INFERENCE directive to diagnostics test data
2017-11-29 02:53:49 +03:00
Dmitry Savvinov
b8447d6d97
Add test on smartcasts with reified types
...
This test introduces very special (for current implementation) case,
when we have smartcast indirectly, via some reified type parameter.
It covers recursive call inSmartCastManager.checkAndRecordPossibleCast(),
which wasn't previously covered by any test in testbase.
2017-11-23 12:45:10 +03:00
Mikhail Glukhikh
3fb0354676
Minor: add / fix comments (related to KT-20752)
2017-10-16 20:00:47 +03:00
Mikhail Glukhikh
a55c6f0c95
Don't register safe cast type info for unstable values
...
Important: to be removed in 1.3
So #KT-20752 Fixed
2017-10-16 16:21:45 +03:00
baratynskiy
01883a41cb
javac-wrapper: refactoring, fixes and tests
2017-08-29 18:01:36 +03:00
Mikhail Glukhikh
a12877e51c
Add feature support for "smart casts on variables in closures"
...
So #KT-14486 Fixed
2017-08-16 12:34:04 +03:00
Mikhail Glukhikh
a086863561
Preliminary: support smart casts on variables in closures
...
No feature support yet
So #KT-14486 In Progress
2017-08-16 12:33:52 +03:00
Mikhail Glukhikh
b2d931fb1f
Support smart casts after if (nullable ?: boolean) #KT-8492 Fixed
2017-08-16 12:33:35 +03:00
Mikhail Glukhikh
80b6aaa802
Support smart casts to Type after x as? Type null check #KT-4565 Fixed
2017-08-16 12:33:12 +03:00
Mikhail Zarechenskiy
ae3497c6ce
Reduce highlighting range for UNCHECKED_CAST
...
#KT-18985 Fixed
2017-08-07 18:49:58 +03:00
Stanislav Erokhin
397103f9d0
[NI] Fix smart cast for expression with captured input type.
2017-07-14 12:43:05 +03:00
Denis Zharkov
bc564af2fc
Regenerate mockJDK using openJDK 7
2017-06-24 17:26:01 +03:00
Mikhail Zarechenskiy
7a9e1b2b1d
Improve diagnostic on overload resolution ambiguity
...
Report type mismatch on argument when a nullable argument is passed to non-null parameter.
Note that this affects only functions with simple types without generics
#KT-2007 Fixed
#KT-9282 Fixed
2017-06-22 13:41:31 +03:00
Mikhail Zarechenskiy
b53a3b324f
Fix 'infix call' diagnostic for in operation
...
#KT-8845 Fixed
2017-06-19 17:36:08 +03:00
Mikhail Glukhikh
630af6a9c6
Correct 1.1-specific test to fix 1.2-M1 build
2017-06-09 13:10:37 +03:00
Mikhail Glukhikh
adbece82ef
Clear DF info for variables assigned in 'try' #KT-17929 Fixed
2017-05-26 15:39:27 +03:00
Mikhail Glukhikh
0fd70df681
Add tests for KT-17929
2017-05-26 15:39:25 +03:00
Dmitry Neverov
cd24adac32
Detect redundant 'is' check
...
#KT-14187 Fixed
2017-05-15 11:24:35 +03:00
Mikhail Zarechenskiy
7541a3754d
Move SAM constructors to synthetic scope
2017-05-05 21:30:35 +03:00
Mikhail Glukhikh
56e633e345
CFA: detect captured writes more precisely
...
So #KT-14381 Fixed
So #KT-13597 Fixed
Also refactors captured writes detection inside DFA
2017-05-02 19:59:23 +03:00
Mikhail Zarechenskiy
7f287a4230
Support warning about useless cast on safe cast
...
#KT-13348 Fixed
2017-04-10 12:48:09 +03:00
mglukhikh
4700936f66
DFA: count null comparison as identity comparison #KT-16538 Fixed
...
+ minor parameter refactoring
2017-03-24 17:33:42 +03:00
Mikhail Glukhikh
b7fb45f36e
DFA: only stable values or qualified with stable receiver can be bound in x = y #KT-15792 Fixed
2017-01-23 13:38:24 +03:00
Mikhail Glukhikh
905e67e713
Data flow information: take language version into account while processing safe calls and bound values #KT-14350 Fixed
2017-01-23 13:38:24 +03:00
Mikhail Glukhikh
b6443eed9e
Data flow information: stable complex expressions introduced back for brackets / elvis / if / when #KT-13468 Fixed
...
This reverts commit e515d7f773 and
also commit 1c9f08e986
(cherry picked from commit 9fa155b)
2017-01-18 18:54:08 +03:00
Mikhail Glukhikh
86bc49558d
Tests for KT-13468 / KT-13765
...
(cherry picked from commit 2e4c0b4)
2017-01-18 18:53:55 +03:00
Alexander Udalov
c1eebacd55
Do not render declarations from other modules in diagnostic tests
...
Because PackageViewDescriptor may consist of several package fragments from
different modules (see LazyPackageViewDescriptorImpl#fragments), we now filter
out fragments from irrelevant modules before rendering them into the .txt
2016-11-25 20:50:21 +03:00
Valentin Kipyatkov
ec51076355
DescriptorRenderer to render annotations for all types + separate option to render annotation arguments + use it in IdeDescriptorRenderers
2016-10-11 23:38:54 +03:00
Valentin Kipyatkov
41ee06ec96
Use parameter names in DescriptorRenderer
2016-10-11 23:38:49 +03:00
Alexander Udalov
090d157f86
Update test data for data classes
2016-09-15 16:45:48 +03:00
Mikhail Glukhikh
6a9d058db4
UNUSED_VALUE is now reported on expression only if this expression is unused in all (e.g. finally) branches #KT-9825 Fixed
...
(cherry picked from commit aac8e94)
2016-08-31 19:28:00 +03:00
Mikhail Glukhikh
d08d8af407
USELESS_ELVIS_RIGHT_IS_NULL : build fix (add to different files in DiagnosticsTestGenerated), do not report if USELESS_ELVIS already exists
...
(cherry picked from commit c71b656)
2016-08-23 16:26:54 +03:00
Mikhail Glukhikh
ae856e834a
Store map (Call to KotlinType) for SMARTCAST slice #KT-13426 Fixed
...
Also EA-86848 Fixed
2016-08-17 16:09:45 +03:00
Mikhail Glukhikh
cbcef67d82
KT-13426: store map from ImplicitReceiver into KotlinType for implicit receiver smart casts
2016-08-17 16:09:34 +03:00
Ilya Gorbunov
d943079557
Exception typealiases rendering in test output
2016-08-17 12:40:50 +03:00
Mikhail Glukhikh
4f7d8e34b0
Data flow values: initializers for local variables are now stored as "bound values" with inherited nullability #KT-6840 Fixed
2016-07-27 16:24:50 +03:00
Mikhail Glukhikh
c7af3f7865
Data flow values: more accurate handling of postfix ++ and --
2016-07-27 16:24:27 +03:00
Mikhail Glukhikh
7c66f632ca
Receiver smart casts: additional test for a?.b() when b is invokable property
2016-07-27 16:24:23 +03:00