Commit Graph

32840 Commits

Author SHA1 Message Date
Pavel V. Talanov ae0d450acf Light class test for classes with dollars in name 2016-07-28 18:00:58 +03:00
Pavel V. Talanov e51957a431 PsiChecker test for classes with dollars in name 2016-07-28 18:00:57 +03:00
Pavel V. Talanov 4ee0f7052f StubClassBuilder: correctly calculate short name when building delegates for light classes 2016-07-28 18:00:56 +03:00
Pavel V. Talanov c85ddc3da2 Do not build light classes for scripts
Supports old behaviour
2016-07-28 18:00:55 +03:00
Pavel V. Talanov 913a1baf56 FqName is not required to create source light classes 2016-07-28 18:00:54 +03:00
Pavel V. Talanov 5a1a1fc03a Drop KtLightClass#getFqName() and some usages of classFqName in KtLightClassForDecompiledDeclaration 2016-07-28 18:00:53 +03:00
Pavel V. Talanov 1fda24fbbf Local classes do not have qualified names
Mirros java psi
2016-07-28 18:00:52 +03:00
Pavel V. Talanov 85fb16ef1b Refactor: restructure light class hierarchy for sources
KtLightClassBase
	| KtLightClassForSourceDeclaration
		| KtLightClassImpl (new!) // top level or inner/nested of top level class
		| KtLightClassForInterfaceDefaultImpls
		| KtLightClassForLocalDeclaration (new!)
			| KtLightClassForAnonymousDeclaration
				| KtLightClassForEnumEntry
2016-07-28 18:00:52 +03:00
Pavel V. Talanov 252235787d Refactor: rename KtWrappingLightClass -> KtLightClassBase 2016-07-28 18:00:51 +03:00
Pavel V. Talanov 999c8e7486 Refactor: rename KtLightClassForExplicitDeclaration -> KtLightClassForSourceDeclaration 2016-07-28 18:00:50 +03:00
Pavel V. Talanov b686b37cbf Refactor: move KotlinCodeBlockModificationListener to 'idea-analysis' module 2016-07-28 18:00:49 +03:00
Pavel V. Talanov 0294551433 Refactor: move OldPackageFacadeClassUtils to 'frontend.jvm' module 2016-07-28 18:00:48 +03:00
Pavel V. Talanov cdbd7fbab0 Refactor: split classes in 'asJava' package into several subpackages to reflect their structure 2016-07-28 18:00:47 +03:00
Nikolay Krasko 033efbda41 Refactoring: move KtLightField interface to file with light elements 2016-07-28 18:00:46 +03:00
Pavel V. Talanov 0b4c6bd889 Drop PsiCodegenPredictor 2016-07-28 18:00:45 +03:00
Dmitry Petrov a08e70879f KT-13161 java static methods call not working for typealias
Introduce special qualifier for type aliases with member scope
containing static class members only.
2016-07-28 17:38:36 +03:00
Nikolay Krasko 5a5cd0e760 Refactoring: extract DebuggerClassNameProvider 2016-07-28 15:33:43 +03:00
Nikolay Krasko 50e196dfb9 Minor: invert if, clean up 2016-07-28 15:33:43 +03:00
Nikolay Krasko 097288d15f Refactoring: fix weak warning about unnecessary escaped dot 2016-07-28 15:33:43 +03:00
Nikolay Krasko e7ee0d1c5e Refactoring: extract pattern to variable and add language injection 2016-07-28 15:33:43 +03:00
Nikolay Krasko 071285fad7 Refactoring: additional changes in smap functions and KotlinExceptionFilter 2016-07-28 15:33:43 +03:00
Nikolay Krasko f71e24403f Refactoring: working with smap methods 2016-07-28 15:33:43 +03:00
Nikolay Krasko fcf0b7a66c Refactoring: extract functions working with smap to separate file 2016-07-28 15:33:43 +03:00
Mikhail Glukhikh 6e391854a0 Data flow values refactoring: removed DataFlowValue.kind.isStable, renamed DataFlowValue.isPredictable -> DataFlowValue.isStable 2016-07-28 15:14:48 +03:00
Denis Zharkov 915e36cb02 Add Map.getOrDefault method as PlatformDependent declaration with refined signature
- First parameter should have type of K instead of Any
- Special bridge should return second parameter if a key has wrong type
- Special bridge may throw an exception if defaultValue has wrong type

 #KT-13209 Fixed
2016-07-27 18:46:13 +03:00
Denis Zharkov 169acf2f31 Refine method's contract and rename it
Basically what's it checked before is that
receiver is a valid override of raw version of builtinWithErasedParameters

While we need to check that method has the same JVM descriptor as builtinWithErasedParameters,
but it's not a valid override of latter

It's important for 'getOrDefault(Object k, V value)' ('getOrDefault(K k, V value)' in Kotlin):
'getOrDefault(Object k, V value)' is not override of 'getOrDefault(Object k, Object value)',
that leads to incorrect loading of former method (like it's not an override of declaration in Map)
2016-07-27 18:46:13 +03:00
Denis Zharkov 15b94bb8df Minor. Move method closer to it's usage and simplify it 2016-07-27 18:46:13 +03:00
Denis Zharkov f2cb86c3f6 Minor. Fix testData 2016-07-27 18:46:13 +03:00
Alexey Andreev efb5a9eca6 KT-13160: when decomposing assignment with lhs like array[index], extract array instead of supporting only qualifier.name` 2016-07-27 18:28:28 +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 7090abddcd Data flow values: variable-based are no more compared with taking kind into account 2016-07-27 16:24:46 +03:00
Mikhail Glukhikh f96b9ddbf5 Minor: unused imports in IdentifierInfo 2016-07-27 16:24:41 +03:00
Mikhail Glukhikh e515d7f773 Data flow analysis: unnecessary assignment removed (related to complex expressions) 2016-07-27 16:24:36 +03:00
Mikhail Glukhikh 1c9f08e986 Data flow values: STABLE_COMPLEX_EXPRESSION kind is removed, no use cases exist for them 2016-07-27 16:24:32 +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
Mikhail Glukhikh 692623cb55 Cleanup: smart casts of safe call receiver applied (do NOT cherry-pick to 1.0.X) 2016-07-27 16:24:18 +03:00
Dmitry Petrov 26c8bc87fd KT-13241 Indices optimization leads to VerifyError with smart cast receiver
Use expected receiver type from the corresponding extension function.
2016-07-27 13:21:22 +03:00
Stanislav Erokhin f3be1b8f1f Add assertion for variable as function call with explicit type parameters. 2016-07-27 13:17:15 +03:00
Mikhail Glukhikh b56e84d47f Cast never succeeds: special 'Nothing' / 'Nothing?' case
(cherry picked from commit 63435b4)
2016-07-27 10:52:13 +03:00
Mikhail Glukhikh bf4231d65a Standard library regenerated
(cherry picked from commit 68af26c)
2016-07-27 10:52:01 +03:00
Mikhail Glukhikh 94029393cb kotlin-stdlib-gen: UNCHECKED_CAST instead of CAST_NEVER_SUCCEEDS
(cherry picked from commit feab6f3)
2016-07-27 10:51:51 +03:00
Mikhail Glukhikh a2b68f65be Suppress CAST_NEVER_SUCCEEDS removed from standard library code
(cherry picked from commit 7d9aa04)
2016-07-27 10:51:41 +03:00
Mikhail Glukhikh b88282c0fc Suppress CAST_NEVER_SUCCEEDS removed from source code
(cherry picked from commit d448a92)
2016-07-27 10:51:30 +03:00
Mikhail Glukhikh a902c4901a CAST_NEVER_SUCCEED: replace subtyping check with subclassing check #KT-13206 Fixed
(cherry picked from commit 5fc797a)
2016-07-27 10:51:13 +03:00
Mikhail Glukhikh 17c824f7f2 KT-13170 related: correct handling of inspection parameters in additional checker
(cherry picked from commit 47fd990)
2016-07-27 10:50:58 +03:00
Mikhail Glukhikh ff2f49fa8f Has platform type inspection: do not report by default on Kotlin types with platform arguments #KT-13170 Fixed
Also #KT-12820 Obsolete
(cherry picked from commit 0589b48)
2016-07-27 10:50:45 +03:00
Mikhail Glukhikh 8600e7348c Can be val inspection: local functions are taken into account #KT-13151 Fixed
(cherry picked from commit 57eb4c1)
2016-07-27 10:50:31 +03:00
Alexander Udalov 0380b6cd88 Never resolve modality of members to SEALED 2016-07-26 21:16:15 +03:00
Alexander Udalov b72293883d Fix algorithm of determining modality for fake overrides
Previously we inferred "open" if there was at least one open member in the
hierarchy. However, that's not correct when that member is overridden by
another member in the hierarchy which is abstract. This led to incorrect code
being accepted by the front-end, and an exception during the bridge generation

 #KT-12467 Fixed
2016-07-26 21:16:15 +03:00