Dmitry Petrov
5e5a1bd686
Use java.lang.Object as a fall-back reference type
...
If for some reason during preliminary analysis in redundant null check
elimination we failed to determine a local variable type statically,
treat it as java.lang.Object.
This will disable some further optimizations using precise type
information (such as INSTANCEOF check elimination), but will not fail
with an exception anyway.
2017-06-27 12:56:34 +03:00
vitaly.khudobakhshov
d165ea9ea7
Add expression type string to the REPL API
...
PR-1131
2017-06-27 11:28:40 +02:00
Alexander Udalov
8783f7a94e
Remove unneeded nullability annotations in CallableReference
2017-06-26 18:46:26 +03:00
Alexey Andreev
20842dcc44
Add module name as a prefix to declaration keys in JS translator
...
This is necessary due to different modules can have same
package declarations. When importing declarations from these
packages, we should distinguish from which module we are importing it.
See KT-18652
2017-06-26 18:16:00 +03:00
Alexey Andreev
3331be9cc8
Fix JS CLI test that fails in Windows
2017-06-26 18:15:30 +03:00
Alexey Andreev
adc04196b1
Support JS source map source embedding configuration in IDEA
2017-06-26 18:15:29 +03:00
Alexey Andreev
a0e1bde594
Allow to embed source files into JS source maps
2017-06-26 18:15:28 +03:00
Nikolay Krasko
73c37ecd25
Remove usage of HighlightingSession.getEditor()
...
It's going to be deleted in IDEA.
2017-06-26 17:39:39 +03:00
Alexander Udalov
0c8ca5f930
Extract some functions from test class into base class
...
To be used in other tests which will be subclasses of
AbstractKotlinCompilerIntegrationTest
2017-06-26 16:22:05 +03:00
Alexander Udalov
69efb81a12
Minor refactoring in JavaModuleInfo
...
Remove unused declarations
2017-06-26 16:22:05 +03:00
Alexander Udalov
fd0658e0f4
Minor, inline unneeded JvmDependenciesIndexFactory
2017-06-26 16:22:05 +03:00
Alexander Udalov
0e2e3b3e65
Cleanup KotlinCoreEnvironment and usages
...
Remove unused API, weaken declaration visibility, reformat
2017-06-26 16:22:05 +03:00
Alexander Udalov
999e4cda1d
Compute module mappings eagerly in JvmPackagePartProvider, refactor
...
Previously we traversed all notLoadedRoots on each request for package
parts with the given package FQ name. Since notLoadedRoots might contain
a lot of roots (which never transition into "loadedModules" because e.g.
they are not Kotlin libraries, but just Java libraries or SDK roots with
the META-INF directory), this was potentially hurting performance. It
seems it's more optimal to compute everything eagerly once
JvmPackagePartProvider is constructed.
Another problem with the previous version of JvmPackagePartProvider was
that it did not support "updateable classpath" which is used by REPL and
kapt2, it only used the initial roots provided in the
CompilerConfiguration. In REPL specifically, we would thus fail to
resolve top-level callables from libraries which were dynamically added
to the execution classpath (via some kind of a @DependsOn annotation).
In the new code, JvmPackagePartProvider no longer depends on
CompilerConfiguration to avoid this sort of confusion, but rather relies
on the object that constructed it (KotlinCoreEnvironment in this case)
to provide the correct roots. This is also beneficial because the
computation of actual VirtualFile-based roots from the ones in the
CompilerConfiguration might get trickier with modular Java 9 roots
2017-06-26 16:22:05 +03:00
Alexander Udalov
a5a78b8f91
Minor refactoring in ClasspathRootsResolver.convertClasspathRoots
...
Package prefix only makes sense for JavaSourceRoot content roots
2017-06-26 16:22:05 +03:00
Alexander Udalov
2424431e16
Extract ClasspathRootsResolver out of KotlinCoreEnvironment
2017-06-26 16:22:04 +03:00
Alexander Udalov
6d48b1c3fb
Minor, extract MessageUtil.virtualFileToPath
2017-06-26 16:22:04 +03:00
Alexander Udalov
8af923c5ff
Refactor MockLibraryUtil and related tests
...
- separate compileLibraryToJar into two public functions, for JVM and JS
- allow to pass any extra options instead of just -Xallow-kotlin-package
- add a bunch of default arguments for the most common cases
2017-06-26 16:22:04 +03:00
Alexander Udalov
68df1d73e7
J2K MockLibraryUtil: prettify
2017-06-26 16:22:04 +03:00
Alexander Udalov
46a6dc6550
J2K MockLibraryUtil: convert
2017-06-26 16:22:04 +03:00
Alexander Udalov
884e85653f
J2K MockLibraryUtil: rename .java -> .kt
2017-06-26 16:22:04 +03:00
Denis Zharkov
c8a2de0243
Allow custom expected result for fast class reading tests
2017-06-24 17:26:02 +03:00
Denis Zharkov
bc564af2fc
Regenerate mockJDK using openJDK 7
2017-06-24 17:26:01 +03:00
Dmitry Jemerov
3158c71c29
Check that we have correct sources for mockjdk
2017-06-24 17:08:11 +03:00
Nikolay Krasko
87889904ee
Allow only one invoke to be a target for smart step into (KT-18632)
...
It's difficult to distinguish such calls reliably in debug session
#KT-18632 Fixed
2017-06-23 21:33:26 +03:00
Mikhail Glukhikh
247c0497b1
Visibility can be private: weaken level to INFO
2017-06-23 18:15:21 +03:00
Mikhail Glukhikh
c99db11ace
Visibility can be private: do not perform too expensive search
...
Also, additional test for usage via accessor was added
So #KT-18617 Fixed
2017-06-23 18:15:20 +03:00
Zalim Bashorov
3358f0ab69
KJS: use korlinc-js runner written in js to make possible to run it on any OS
...
Restore executable attributes on kotlinc* bash scripts after copying them.
2017-06-23 15:14:35 +03:00
Nikolay Krasko
502ac80b89
Do not skip invoke call on parameters during smart step into (KT-18577)
...
#KT-18577 Fixed
2017-06-23 13:47:33 +03:00
Nikolay Krasko
e5ce91dc5b
Show receiver for invoke calls in smart step into popup
2017-06-23 13:47:33 +03:00
Alexey Sedunov
9681f5ca42
Generate equals/hashCode(): Enable for classes without properties
...
Also:
- forbid for enum classes
- use javaClass.hashCode() instead of 0 if class has no properties
#KT-18418 Fixed
2017-06-22 19:50:55 +03:00
Alexey Sedunov
895407f5e3
Rename: Do not silently rename all parameters in function hierarchy
...
#KT-18325 Fixed
2017-06-22 19:50:54 +03:00
Alexey Sedunov
31d21a14f2
Copy: Disable when selection doesn't contain Kotlin source files
...
#KT-18390 Fixed
2017-06-22 19:50:53 +03:00
Alexey Sedunov
423fb9dfb3
Move/Copy: Warn about usages of JDK when moving to non-JVM module
...
#KT-18135 Fixed
2017-06-22 19:50:52 +03:00
Alexey Sedunov
1d36c49537
Copy: Copy elements and process usages under the same write action
...
In some cases doing these operations in separate write actions
may lead to invalidation of copied elements
#KT-18149 Fixed
2017-06-22 19:50:51 +03:00
Alexey Sedunov
6b18ff1d97
Copy/Move: Fix processing of calls used as callees
...
#KT-18241 Fixed
2017-06-22 19:50:50 +03:00
Mikhail Zarechenskiy
87a41293e8
Improve diagnostics on callable reference of unresolved class
...
#KT-10839 Fixed
2017-06-22 15:02:13 +03:00
Mikhail Zarechenskiy
0579604653
Do not propose to specify constructor invocation in diagnostics
...
#KT-17188 Fixed
2017-06-22 15:02:10 +03:00
Mikhail Zarechenskiy
0f350f5db8
Don't report error on member that overrides open member from final class
...
#KT-14598 Fixed
2017-06-22 15:02:09 +03:00
Mikhail Zarechenskiy
9847278699
Report error about invalid if as expression on the if keyword
...
#KT-14633 Fixed
2017-06-22 14:18:11 +03:00
Mikhail Zarechenskiy
e40c8fff05
Make resolution status name more precise
2017-06-22 13:50: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
16de991b07
Add test for obsolete issue
...
#KT-8262 Obsolete
2017-06-22 13:41:30 +03:00
Mikhail Zarechenskiy
4b3ffd9418
If all candidates are invisible then don't report ambiguity
...
#KT-10045 Fixed
2017-06-22 13:41:28 +03:00
Mikhail Zarechenskiy
cd1ae7f0f2
Add resolution status to report about unsuccessful smartcast
...
#KT-10248 Fixed
#KT-11119 Fixed
2017-06-22 13:41:27 +03:00
Mikhail Zarechenskiy
0f4497256b
Report about wrong number of type arguments instead of ambiguity
...
#KT-7975 Fixed
#KT-1809 Fixed
2017-06-22 13:05:10 +03:00
Dmitry Jemerov
24f1bbfb46
Add code for configuring eap-1.2 bintray repo
...
#KT-18316 Fixed
2017-06-22 11:01:03 +02:00
Dmitry Petrov
2b3043bf9f
Fix CFG problem for 'when' in Konan
...
If type of 'when' expression is 'Nothing', it should be kept that way
even if the expression itself is implicitly coerced to Unit.
2017-06-22 10:21:54 +03:00
Alexander Udalov
1f34dfabd5
Use kotlin.Lazy for script definition computation, add test for no definition
2017-06-22 10:19:06 +03:00
Ilya Chernikov
4178188e15
Fix name retrieval on exception reporting during analysis
2017-06-22 10:19:05 +03:00
Alexander Udalov
135f0a136e
CLI: report error if the first argument for "-script" is not kts
...
#KT-3045 Fixed
2017-06-22 10:19:05 +03:00