Commit Graph

59069 Commits

Author SHA1 Message Date
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
Denis Zharkov 5e0e78e555 FIR: Rewrite supertype resolution 2019-11-13 10:52:24 +03:00
Alexander Udalov 9a55f418fa IR: extract StaticInitializersLowering out of InitializersLowering
And use it in JVM backend only. Also remove unneeded
`patchDeclarationParents` call.
2019-11-12 19:21:46 +01:00
Alexander Udalov 098561dd5f IR: cleanup InitializersLowering.kt 2019-11-12 19:19:03 +01:00
Alexander Udalov 9772de0088 JVM IR: generate kotlin.Metadata.packageName value for JvmPackageName files
Support this for single file facades as well as for multi-file classes,
similar to code in
MultifileClassCodegen.writeKotlinMultifileFacadeAnnotationIfNeeded.
Extend the test on this attribute to also cover multi-file classes.
2019-11-12 19:13:03 +01:00
Ilya Chernikov 808000e458 Implement warning when non-abstract classes containing abstract members invisible from that classes
#KT-27825 fixed
2019-11-12 19:08:53 +01:00
Dmitriy Novozhilov eae3688c61 [FIR] Fix collecting approved data flow info from rhs of boolean operator 2019-11-12 21:03:54 +03:00
Dmitriy Novozhilov 8d6cfdf0b1 [FIR] Fix passing data flow info from while loop condition 2019-11-12 21:03:54 +03:00
Dmitriy Novozhilov 7ef13caa33 [FIR] Add test for ambiguity in nested class constructor call 2019-11-12 21:03:54 +03:00
Dmitriy Novozhilov e9551e2022 [FIR] Don't generate setter by delegate for vals 2019-11-12 21:03:54 +03:00
Dmitriy Novozhilov 2f2aa4ae83 [FIR] Create error type instead of implicit type for incorrect functional types 2019-11-12 21:03:54 +03:00
Dmitriy Novozhilov cf61a6c30f [FIR] Add support of multiple condition branches to exhaustiveness checker 2019-11-12 21:03:53 +03:00
Roman Artemev 86570a2f91 [KLIB] Promote ABI version 2019-11-12 21:00:32 +03:00
Roman Artemev 63110ab636 [IR] Remove deprecated correspondingProperty from IrField 2019-11-12 20:45:11 +03:00
Roman Artemev 646df8d40a [IR BE] Get rid of descriptor usage in KCallable name property lowering 2019-11-12 20:45:11 +03:00
Roman Artemev ec1c2eb42d [IR] Remove deprecated correspondingProperty from IrSimpleFunction 2019-11-12 20:45:11 +03:00
Roman Artemev a343a57207 [IR] Refactor ir infrastructure
- Remove range-based uniq id indexes using to link built ins
 - Limit KotlinType usages, replace them with corresponding IrType
2019-11-12 20:45:11 +03:00
Roman Artemev 90d07eee53 [IR] Move wrapped descriptors from backend.common to ir.descriptors 2019-11-12 20:45:11 +03:00
Roman Artemev ed79ab68ab [IR] Remove DeclarationDescriptor from IrExpression* tree API 2019-11-12 20:45:11 +03:00
Roman Artemev d4fc7fcd96 [IR] Get rid of substituted descriptor from IrMemberAccessExpression interface 2019-11-12 20:45:11 +03:00
Roman Artemev b391c066d6 [IR] Pass class Type Parameters into IrConstructorCall factory explicitly
to avoid unexpected crash on uninitialized parent in psi2ir phase
2019-11-12 20:45:11 +03:00
Roman Artemev ba373c67d7 [IR] Remove FunctionDescriptor from IrCall-like node's constructor interface 2019-11-12 20:45:11 +03:00
Roman Artemev bf367003f9 [IR] Make IrMemberAccessExpression be IrDeclarationReference 2019-11-12 20:45:10 +03:00
Roman Artemev eee594101a [IR] Remove superQualifier property from IrCall 2019-11-12 20:45:10 +03:00
Ilmir Usmanov ea5b529d19 Check default parameters of expect suspend functions on original
functions instead of function views.
 #KT-24461 Fixed
2019-11-12 20:12:37 +03:00
igoriakovlev 633d1c9ea3 Merge pull request #2773 from t-kameyama/KT-28607
KT-28607 Extract/Introduce variable fails if caret is just after expression
2019-11-12 19:13:56 +03:00
Svyatoslav Kuzmich 42c4591df8 [JS IR] Add -Xgenerate-dts CLI argument 2019-11-12 18:19:06 +03:00
Toshiaki Kameyama e81fbe0a05 Folding: fold function with expression body (KT-6316)
#KT-6316 Fixed
2019-11-12 16:07:52 +03:00
Toshiaki Kameyama 58fb1dede3 Multiline string enter handler: do not insert 'trimIndent()' in const (KT-34785)
#KT-34785 Fixed
2019-11-12 16:07:52 +03:00
pyos ce0fb662c0 JVM_IR: fold inline lambdas when computing OUTERCLASS
so that the enclosing method of objects defined inside lambdas is the
one they are declared in.

Note that this does not fix *all* enclosingInfo tests because JVM_IR
currently follows the KT-28064 proposal, i.e. does not regenerate
objects defined inside lambdas under any circumstances. For example,
this causes test boxInline/enclosingInfo/inlineChain2.kt to fail because
the enclosing method of objects is _2Kt.box instead of (non-existent in
source code) `_2Kt$box$inlined$call$1.invoke` or whatever. What's more
important is that OUTERCLASS no longer points to a non-existent
`box$lambda-N` and therefore `.enclosingMethod` no longer throws.
2019-11-12 12:44:46 +01:00
pyos f906524d76 Mark a SAM conversion test as JVM-only 2019-11-12 12:24:55 +01:00
Mikhail Glukhikh c66b6b6a3a FIR visibility check: support companion private members correctly 2019-11-12 11:24:31 +03:00
Mikhail Glukhikh e96aeb77a6 FIR visibility check: support private class members 2019-11-12 11:24:25 +03:00
Mikhail Glukhikh a5ad05083a Add some stubs for FIR visibility checking 2019-11-12 11:24:24 +03:00
Mikhail Glukhikh 7e07b88eab Code cleanup: FirCallResolver 2019-11-12 11:03:59 +03:00
Mikhail Glukhikh ac13a8c8b2 Cone conflict resolver: extract JVM equivalent call filtering to a separate class 2019-11-12 11:03:58 +03:00
Mikhail Glukhikh 96c5003a13 Cone conflict resolver: filter equivalent top-level callables 2019-11-12 11:03:58 +03:00