Commit Graph

59106 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 2a74e37e28 [FIR] Ignore expected type for resolve constant expressions 2019-11-14 18:33:46 +03:00
Dmitriy Novozhilov 6a3c07688f Add print of detailed stack trace to NonFir modularized test 2019-11-14 18:33:46 +03:00
pyos a235dd2891 IR: move defaultParameterDeclarationsCache access up one level
to avoid recomputing overriddenSymbols for fake overrides of default
stubs on repeated calls to generateDefaultsFunction.
2019-11-14 17:41:47 +03:00
pyos 70f09a7531 IR: make DefaultArgumentStubGenerator a few lines shorter 2019-11-14 17:41:47 +03:00
pyos 2b2dd097a3 IR: refactor DefaultParameterInjector 2019-11-14 17:41:47 +03:00
pyos 7a2715da44 IR: refactor generateDefaultsFunction
The check for whether a function needs a default stub should run fewer
times now, and in particular is no longer quadratic. Also, this fixes
a weirdness in that certain inheritance hierarchies would produce
a default stub that points to a non-stub through its overriddenSymbols
field.
2019-11-14 17:41:47 +03:00
pyos 29a14e2330 JVM_IR: resolve inline fake overrides before codegen
See KT-33054 and KT-29242.
2019-11-14 15:29:24 +01:00
Dmitriy Dolovov 1b2091d536 Fix: KLIB reading error on Windows
Issue #KT-34909
2019-11-14 20:37:43 +07:00
Ilya Goncharov 77950c5410 [Gradle, JS] Remove redundant from kotlin-test-js-runner 2019-11-14 16:03:54 +03:00
Ilya Goncharov 6a6bef0f6c [Debugger, JS] Remove kotlin source map support from tests and build 2019-11-14 15:53:18 +03:00
Ilya Goncharov 35cb412dc3 [Gradle, JS] Fix source map support initializing for mocha 2019-11-14 15:53:18 +03:00
Ilya Goncharov 4e427d2ce4 [Gradle, JS] Fix source map support initializing for nodejs 2019-11-14 15:53:18 +03:00
Ilya Goncharov 20e33806ec [Debugger, JS] Provide possibility to debug mocha tests 2019-11-14 15:53:18 +03:00
Igor Yakovlev 30b4622a45 Remove invalid unused reference 2019-11-14 14:54:44 +03:00
Sergey Rostov c905bbca36 Scripting: invalidate caches on roots changes 2019-11-14 14:01:30 +03:00
Denis Zharkov b0327964b7 Fix compilation on 183 and as34 2019-11-14 11:26:11 +03:00
Anatoly Nikitin c7e9a6c5d9 Add new script dependency resolvers
Changes in new API for dependency resolvers (GenericDependenciesResolver) comparing to an old one (GenericResolver:
- Add ability to fast check whether artifact or repository is suitable for current resolver to distinguish between unsuitable resolvers and resolution failures
- Return all artifact resolution failures in ResultWithDiagnostics
- Use single string for artifact coordinates
- Add compound resolver that combines several resolvers
- Merge Direct and FlatLib resolver into single FileSystemDependencyResolver
- Mark resolve() method as suspend to indicate long operation
- Add credentials support for maven resolver (https://youtrack.jetbrains.com/issue/KT-27701)
2019-11-14 08:38:50 +01:00
Anatoly Nikitin 81e2e119e2 Fix propagation of dependency resolution failure reports during script compilation 2019-11-14 08:38:50 +01:00
Mikhael Bogdanov 744dfc6bf9 Minor. Pass proper timeout to logger 2019-11-14 08:32:36 +01:00
Mikhael Bogdanov 4281fd6bd5 Don't write nop for extension lambda during inline 2019-11-14 08:17:33 +01:00
Sergey Rostov b757224df1 Scripting: invalidate caches on roots changes 2019-11-14 09:50:03 +03:00
Sergey Rostov df0c250fd8 Scripting: fix lost caches clearing call 2019-11-14 09:50:03 +03:00
Sergey Rostov 542f21b701 Scripting, minor: cache firstScriptSdk 2019-11-14 09:50:03 +03:00
Vladimir Ilmov ab3f9586b3 Suspend function calls highlighting added.
'If' highlighting fixed at settings sample area.

 #KT-27496 Fixed
2019-11-14 08:07:56 +03:00
Vladimir Ilmov 46423443e9 'it' parameter highlighting fixed for chain usage.
#KT-31037 Fixed
2019-11-14 08:07:56 +03:00
Alexander Udalov fb9fb2e048 JVM IR: minor, remove obsolete code 2019-11-13 19:30:26 +01:00
Alexander Udalov 180e718752 JVM IR: minor, repurpose JvmBackendContext.getLocalClassInfo to store Type 2019-11-13 19:26:40 +01:00
Alexander Udalov 6be9101675 JVM IR: add jvmLocalClassExtractionPhase to lift out local classes from initializers
Otherwise a local class in a field initializer or anonymous init block
is copied into each constructor of the containing class (because
InitializersLowering calls deepCopy).

Since the code structure no longer resembles the original source code
here, record a custom EnclosingMethod mapping before moving such
classes, and use it in codegen.
2019-11-13 19:26:39 +01:00
Georgy Bronnikov c5159d9cbe IR: Add UniqId to IrSymbol 2019-11-13 20:07:57 +03:00
Georgy Bronnikov 1647279a8c IR: move UniqId to ir.tree module 2019-11-13 20:07:57 +03:00
Georgy Bronnikov 76016b1a3c IR: move KotlnMangler to ir.tree module 2019-11-13 20:07:57 +03:00
Georgy Bronnikov 92ebb092a2 JvmMangler 2019-11-13 20:07:57 +03:00
Georgy Bronnikov 2f5442800b Move WrappedDescriptors to ir.tree module 2019-11-13 20:07:57 +03:00
igoriakovlev cb11282183 Merge pull request #2516 from t-kameyama/KT-18539
KT-18539 Default implement fun/property text shouldn't contain scary comment
2019-11-13 19:33:44 +03:00
Sergey Igushkin 3429c07016 Fix Native dependencies not transformed when imported from a source set
Those were only transformed when imported from compilations, not
intermediate source sets. Ue the substitutor for source set dependencies
as well.

(minor) extract function for the Gradle module-qualified IDs
2019-11-13 17:45:31 +03:00
Sergey Igushkin 94f66c237b (minor) replace the predicate for intermediate source set
Use a condition that is safe in projects with just one target and
intermediate source sets.
2019-11-13 17:45:31 +03:00
Dmitry Savvinov bcabbcf3e1 Add Native stdlib to intermediate source set dependencies
Also fix the dependsOn source set IDs not matcing those
in the IDE.
2019-11-13 17:45:25 +03:00
Igor Yakovlev 1ccda6a8d4 Add fast find usages for data class components
This commit add feature for disabling searching for data class ComponentN method and destruction declarations that could encrease usages search.
See KT-23278
2019-11-13 17:38:35 +03:00
Natalia Selezneva 6d9c00addd Do not add preparation task to project import if registry option is switched off 2019-11-13 15:18:31 +03:00
Mikhail Zarechenskiy 455b9f852d [NI] Disable caching of LHS expression types for "+=" operators
New behavior was introduced in ab506c1579 which breaks compilation on IDE module (see test example) for new inference.

 Now we temporarily disable this optimisation. This is temporarily restriction which will be fixed once we'll have the same rules for lambdas completion

 #KT-34889 Open
2019-11-13 15:07:39 +03:00
Kristoffer Andersen 4973baae4e [JVM IR] Fix JvmOverloads+Parameterless Main
Resolves the interaction of @JvmOverloads annotations and
parameterless main methods.

In the following code, both mechanisms generate methods that
ultimately produce the signature `public static void main(String[] args)`
of which there can be only one (true in general of any signature).

```
fun main() { }

@JvmOverloads
fun main(Array<String> args, x: Int = 42) { }
```

This PR simply shuffles the lowerings around, letting parameterless
main methods detect the presence of the default overload produced by
the annotation.

Additionally, this PR improves the testing of parameterless main
methods by actual bytecode patterns, and not simple check for
successful compilation (as @sfs and I discovered, there are issues in
flagging an error on duplicate signatures on the IR backend).
2019-11-13 13:03:14 +01:00
Sergey Rostov b4185c9d47 ScriptClassRootsCache: load configuration if it is not cached 2019-11-13 12:39:02 +03:00
Sergey Rostov a84e948051 Scripting: pass KtFile to ScriptConfigurationLoader 2019-11-13 12:39:02 +03:00
Pavel Kirpichenkov 9a231bbbfa Update trailing lambda quickfix, add tests
Case of incorrect call expression as the receiver of dot-qualified expression
was not handled properly.

Now the following order is used:
- If parent is a call expression or if this call is a receiver of parent
dot-qualified expression, parent must get last lambda as a new receiver;
- Otherwise, if parent is a dot-qualified expression, this call is in selector position.
Then grandparent is checked for being call or dot-qualified expression. If so, trailing
lambda must become grandparent's new receiver. If not, trailing nodes become standalone
epressions after parent.
- Otherwise, incorrect call expression is a standalone expression, so trailing nodes
may be lifted and put after it.
2019-11-13 11:00:01 +03:00
Pavel Kirpichenkov f1934fa49d Amend "Terminate preceding call with semicolon" quickfix
Quickfix wasn't aware of cases, when expression to be fixed
 is a part of parent call expression or dot-qualified expression.
 Incorrect position for extracting trailing lambdas led to broken
 formatting.

 #KT-34694 Fixed
2019-11-13 11:00:01 +03:00
Denis Zharkov 0f638db3e5 FIR: Turn SupertypeSupplier into a class 2019-11-13 10:52:24 +03:00
Denis Zharkov 56b5d170eb FIR: Minor. Rename FirSupertypeResolverTransformerAdapter -> FirSupertypeResolverTransformer 2019-11-13 10:52:24 +03:00
Denis Zharkov 3a4f9e9109 FIR: Drop FirClassLikeDeclaration::supertypesComputationStatus
It became unused with rewritten supertype resolution
2019-11-13 10:52:24 +03:00
Denis Zharkov 2fba6b54a0 FIR: Minor. Drop old FirSupertypeResolverTransformer 2019-11-13 10:52:24 +03:00
Denis Zharkov 3f7bffa6fd FIR: Do not use FirClass::supertypesComputationStatus 2019-11-13 10:52:24 +03:00