Commit Graph

38008 Commits

Author SHA1 Message Date
Alexey Andreev 466540399c Fix translation of copy() fun in data class
Fix translation of copy() function in data class which has secondary
constructor in JS BE. See KT-16717.
2017-03-28 11:32:44 +03:00
Mikhail Zarechenskiy b46205f60b Add tests to check collection literals with varargs 2017-03-28 09:01:57 +03:00
Sergey Igushkin ae2b4f5ff2 Support omitting version of org.jetbrains.kotlin dependencies
Related to #KT-12792
2017-03-28 03:57:38 +03:00
Sergey Igushkin 9ba84df954 Fixed classes copying fail in cases when destinationDir has changed
Added @Input to the property returning classes dirs: it will make
Gradle fall back to non-incremental input when the property value
changes.

Issues: #KT-16820 Fixed
2017-03-28 03:53:11 +03:00
Jonathan Leitschuh cc0ac36fed Java IC compatibility fix for Gradle 2.14+
Added version check to switch between old and new approaches because
Gradle versions before 2.14 have a bug in Java IC.
Added Kotlin classes to Java task input.
Added  annotationsFile into task input to include it into up-to-date check.

Related issues: #KT-16585 Fixed
2017-03-28 03:47:21 +03:00
Anton Bannykh 9b34e21619 JS: fixed <Type>Array.iterator methods; added -Xtypedarray compiler key
The <Type>Array.iterator used to lack next<Type>() method (KT-16626).

The -Xtypedarray compiler key enables translation of primitive arrays
to TypedArrays, and primitive array`is`-checks (KT-15358, KT-14007,
KT-14614, KT-16056).
2017-03-27 23:09:34 +03:00
Vyacheslav Gerasimov ba5e78a917 Replace deprecated Iterators.emptyIterator() in JavaContext.java
with ContainerUtil.emptyIterator()
2017-03-27 21:35:11 +03:00
Pavel V. Talanov ca6516c2a2 findDecompiledDeclaration: find builtIns more accurately
Use resolveScope of a reference to help searching for builtIn binaries
Do not search non-builtIn descriptors in random scopes
2017-03-27 21:24:45 +03:00
Dmitry Jemerov 265e765ec9 Allow to exclude specific qualified names from import in tests
In tests, ImportFix imports the first available candidate. This can
lead to non-deterministic tests when multiple candidates are available.
With this fix, unwanted candidates can be excluded.
2017-03-27 19:48:59 +02:00
Dmitry Jemerov 88372132be Delete Android facet in teardown 2017-03-27 19:48:58 +02:00
Dmitry Jemerov 79c814636e Convert AddOpenToClassDeclarationTest to regular multifile quickfix test 2017-03-27 19:48:52 +02:00
Dmitry Jemerov 4f229c3fdc Convert AbstractQuickFixMultiFileTest to light fixture test case 2017-03-27 19:48:51 +02:00
Dmitry Jemerov 387dbdf3bb AbstractQuickFixMultiFileTest: J2K 2017-03-27 19:48:50 +02:00
Dmitry Jemerov d11ea64f00 AbstractQuickFixMultiFileTest: rename to .kt 2017-03-27 19:48:49 +02:00
Dmitry Jemerov e2f75463d7 Rewrite AbstractQuickFixTest based on light fixture test case
Don't reconfigure runtime before every test. For consistency,
mark tests that require the runtime with directives instead of relying
on test file names.
2017-03-27 19:48:43 +02:00
Dmitry Jemerov 34ad19a912 AbstractQuickFixTest: J2K 2017-03-27 19:45:50 +02:00
Dmitry Jemerov ad59a122ac AbstractQuickFixTest: rename to .kt 2017-03-27 19:45:50 +02:00
Dmitry Jemerov 9d74657f11 Mark KotlinCodeInsightTestCase as deprecated 2017-03-27 19:45:50 +02:00
Dmitry Jemerov 9a5028c4f2 Convert KotlinShortNamesCacheTest to light test case; cleanup code 2017-03-27 19:45:50 +02:00
Dmitry Jemerov 159c2382b4 Convert KotlinChangeSignatureTest to light test case 2017-03-27 19:45:50 +02:00
Dmitry Jemerov e9998aa329 AbstractResolveByStubTest: convert to light test case 2017-03-27 19:45:50 +02:00
Dmitry Jemerov d8bbb8f2ef AbstractResolveByStubTest: J2K 2017-03-27 19:45:50 +02:00
Dmitry Jemerov 49aaa0edf6 AbstractResolveByStubTest: rename to .kt 2017-03-27 19:45:50 +02:00
Alexander Udalov ccd3781403 Disallow using named arguments for members of header classes
#KT-17083 Fixed
2017-03-27 20:10:18 +03:00
Alexander Udalov b971ac9312 Allow impl declarations to have flexible types
Types of the corresponding parameters (or type parameter bounds, types
in supertypes, etc) are now compatible not only if they're equal, but
also if values of those types are mutually assignable (if "a" is subtype
of "b" and "b" is subtype of "a")

 #KT-17005 Fixed
2017-03-27 20:10:17 +03:00
Alexander Udalov 116380a826 Allow impl declarations to have non-stable parameter names
#KT-17027 Fixed
2017-03-27 19:50:25 +03:00
Alexander Udalov 633798db18 Render incompatible impl member in "no impl for header" diagnostic 2017-03-27 19:50:25 +03:00
Alexander Udalov db1f039586 Serialize and deserialize 'header' modifier for descriptors
This fixes KT-17001 because now 'header' modifier is loaded correctly
for deserialized members and the standard disambiguation in
OverloadingConflictResolver.compareCallsByUsedArguments takes place,
where header members are discriminated against the corresponding impl
members

 #KT-17001 Fixed
2017-03-27 19:50:25 +03:00
Pavel V. Talanov ee33879031 Light class tests: hidden deprecated affects codegen
Provide fix later
2017-03-27 17:59:05 +03:00
Pavel V. Talanov e822a17c0d Lazy light classes: can't use laziness for classes with supertypes delegates 2017-03-27 17:59:03 +03:00
Pavel V. Talanov 2291d91109 KtLightMethod: isVarArgs() does not trigger exact delegate computation 2017-03-27 17:59:01 +03:00
Pavel V. Talanov c4be805962 Light members: allow to get modifier list without computing delegate 2017-03-27 17:58:59 +03:00
Pavel V. Talanov e84a674504 LazyLightClassDataHolder: rollback optimization on suspected inherited internal visibility
Internal visibility affects member names
2017-03-27 17:58:57 +03:00
Pavel V. Talanov ec895f18f2 Light classes: refactor, move getOrigin to corresponding classes 2017-03-27 17:58:55 +03:00
Pavel V. Talanov a2511232ab Lazy light classes: fix visibility modifier in case of inherited protected visibility 2017-03-27 17:58:53 +03:00
Pavel V. Talanov a81bac0b50 LightClassTest: test corner cases related to inherited visiblity
EA-99155
 #KT-16899 Fixed
2017-03-27 17:58:51 +03:00
Pavel V. Talanov 4b85fd9fbe Refactor light members: introduce KtLightMemberImpl
Holds common code for fields and methods
2017-03-27 17:58:49 +03:00
Pavel V. Talanov a44aa8e112 Introduce KotlinOverridableInternalMembersShortNameIndex
Keeping track of all potentially overridable internal members
To optimize certain scenarios in light classes
2017-03-27 17:58:47 +03:00
Pavel V. Talanov 24303c8b39 Minor, stubs: isTrait -> isInterface 2017-03-27 17:58:45 +03:00
Alexander Udalov 1c7ac2da5a Do not use CoreJavaFileManager in KotlinCliJavaFileManagerImpl
The inheritance is still needed because of the code in intellij-core,
specifically in JavaCoreProjectEnvironment.addSourcesToClasspath and
CoreJavaDirectoryService.getPackage, which assumes that the
JavaFileManager instance in the project is a CoreJavaFileManager
2017-03-27 17:19:25 +03:00
Alexander Udalov c67eb84369 Support nested classes in KotlinCliJavaFileManagerImpl.findClass
findClass(String, GlobalSearchScope) is invoked for example when we're
resolving supertypes of classes in Java libraries. Previously, it never
found nested classes and falled back to CoreJavaFileManager's
implementation, which lacks a fix for the original issue (KT-12664,
which was fixed in JvmDependenciesIndex in 5a533a52 and 164c72e8)

 #KT-16931 Fixed
2017-03-27 17:19:24 +03:00
Alexander Udalov f1a1ebae01 Refactor JvmDependenciesIndex
- Move collectKnownClassNamesInPackage to the only place where it's used
- Fix warnings/inspections and simplify implementation a bit
2017-03-27 17:19:24 +03:00
Alexander Udalov 801a93edbc Refactor KotlinJavaPsiFacade.KotlinPsiElementFinderImpl
Split KotlinPsiElementFinderImpl into two classes: one is used in the
compiler (boolean field isCliFileManager previously handled that), the
other is used in IDE and possibly other non-CLI scenarios.

Also avoid a possible class cast exception in
KotlinJavaPsiFacade.knownClassNamesInPackage
2017-03-27 17:19:24 +03:00
Dmitry Jemerov d8dfad875d Drop pre-1.0 whole-project syntax migration actions 2017-03-27 14:57:44 +02:00
Alexander Udalov d615aba4cf Update KotlinVersion.CURRENT to 1.1.3 2017-03-27 10:48:18 +03:00
Mikhail Zarechenskiy 3f1a43a743 Minor, update test data
See 8466270 for the reason.
 Note that actually we do not report errors on such cases because psiElement is not valid, but in tests for intentions we check all errors
2017-03-27 10:36:10 +03:00
Alexey Sedunov 298ee266c3 Move: Fix conflict checking when switching between similar libraries
#KT-17006 Fixed
2017-03-26 12:56:26 +03:00
Alexey Sedunov 45b8cd29e1 Resolution Facade: Add explicit property for file target platform 2017-03-26 12:56:25 +03:00
Alexey Sedunov 87ea13b307 Move: Fix runtime unconfiguration for multiple modules 2017-03-26 12:56:24 +03:00
Alexey Sedunov 1d0162402e Move: Fix processing of calls and callable references
Fix CCE on callable references to Java methods.
Fix qualification of callable references without receivers.
Fix processing of calls/callable references to object extensions
and extension members.
Do not explicate short companion references

 #KT-16809 Fixed
2017-03-26 12:56:24 +03:00