Commit Graph

431 Commits

Author SHA1 Message Date
Ilya Kirillov 2f12b8f87f FIR: refactoring, move class Java class building to separate fun 2021-01-27 21:15:28 +01:00
Stanislav Erokhin d24331955e Rename FirConstKind to ConstantValueKind and move it to compiler.common 2021-01-14 12:12:25 +01:00
Mikhail Glukhikh 4e4293b609 [FIR] Introduce separate getTopLevelFunction/PropertySymbols 2021-01-11 17:52:51 +03:00
Alexander Udalov 77a9d14f93 Capitalize/decapitalize only ASCII characters across project
Use {de,}capitalizeAsciiOnly and to{Lower,Upper}CaseAsciiOnly where
possible, and stdlib's functions with Locale.US everywhere else.

Otherwise, if the default system locale is Turkish, the capital latin
letter "I" is transformed in toLowerCase to "ı" (see
https://github.com/JetBrains/kotlin/blob/66bc142f92085047a1ca64f9a291f0496e33dd98/libraries/stdlib/jvm/test/text/StringJVMTest.kt#L119),
which for example breaks the codegen for `intArrayOf` in
KT-25400/KT-43405.

Similarly, lower case latin letter "i" is transformed to "İ".

 #KT-13631 Fixed
 #KT-25400 Fixed
 #KT-43405 Fixed
2020-12-28 16:10:30 +01:00
Jinseong Jeon 8c7b23a8dd FIR Java/JVM: avoid plain "Array" comparison 2020-12-28 12:45:51 +03:00
Jinseong Jeon 383de7a9c5 FIR Java: Fix Java override ambiguity with vararg value type
#KT-44066 Fixed
2020-12-28 12:45:51 +03:00
Mikhail Glukhikh d663f204e5 FIR Java: make method annotations lazy 2020-12-28 12:06:51 +03:00
Mikhail Glukhikh c8c34ebf17 FIR Java: make constructor annotations lazy 2020-12-28 12:06:45 +03:00
Mikhail Glukhikh 56df95b8e7 FIR Java: make field annotations lazy 2020-12-28 12:06:39 +03:00
Mikhail Glukhikh 8c8f81330a FIR Java: make value parameter annotations lazy 2020-12-25 14:07:16 +03:00
Mikhail Glukhikh 1239a8629e FIR Java: make type annotations lazy 2020-12-25 14:06:34 +03:00
Roman Golyshev f00e5b1992 FIR: Check relativeClassName of found class in JavaSymbolProvider
`ClassId` denotes how class is nested; however, you can find
`foo/bar/Outer.Nested` class by `ClassId(foo/bar/Outer/Nested)`. This
will lead to inconsistencies when working with class symbol later

This is also important to `FirQualifierResolverImpl::resolveSymbol`
which detects correct `ClassId` by traversing all symbol qualifiers

We check only `relativeClassName`, because we want to be able to find
classes without package specified

Also, fix test data of resolve tests that have been passing because of
check absence
2020-12-24 14:25:48 +00:00
Mikhail Glukhikh 0e43eaa662 Don't call possibleGetterNamesByPropertyName without a reason 2020-12-16 19:50:13 +03:00
pyos 5efe774dba FIR: remap Java meta-annotations to Kotlin equivalents
This is a direct port of JavaAnnotationMapper from the old frontend.
2020-12-10 20:52:43 +03:00
Mikhail Glukhikh 7b277600a9 Optimize/simplify loadFunctions(Properties)ByName in FIR deserializer 2020-12-10 15:29:45 +03:00
Mikhail Glukhikh e51503ab42 Code cleanup: KotlinDeserializedJvmSymbolsProvider 2020-12-10 15:29:45 +03:00
Mikhail Glukhikh 1383e923ea Drop KotlinDeserializedJvmSymbolsProvider.findRegularClass 2020-12-10 15:29:45 +03:00
Mikhail Glukhikh d90cc452fe Simplify: FirSymbolProvider.getClassDeclaredPropertySymbols 2020-12-10 15:29:44 +03:00
Mikhail Glukhikh 5daa406cdf Use FirNamedFunctionSymbol in FirScope.processFunctionsByName 2020-12-09 19:53:27 +03:00
Mikhail Glukhikh 91834ccf46 Use FirNamedFunctionSymbol in FirSimpleFunction & its inheritors 2020-12-09 19:53:19 +03:00
Mikhail Glukhikh 15021f30ff Use FirNamedFunctionSymbol around processOverriddenFunctions 2020-12-09 19:53:18 +03:00
pyos 6cb573cb45 [FIR] Import parents of companion objects first
Otherwise, information about members moved from companion objects to the
parent class (e.g. on JVM, companion object fields -> static fields in
parent class) will be incorrect.
2020-12-02 15:29:42 +03:00
Mikhail Glukhikh eae8821dec FIR Java: unbind possible named annotation cycle 2020-12-02 14:48:46 +03:00
pyos 1cccf2645f FIR: serialize HAS_CONSTANT at least for const properties
Non-const properties may need them too with if the 1.4 feature
NoConstantValueAttributeForNonConstVals is disabled.
2020-11-30 13:05:28 +03:00
Mikhail Glukhikh 04d9afe83e FIR Java: add workaround for classId = null in JavaAnnotation 2020-11-30 13:05:27 +03:00
Mikhail Glukhikh 9b30655d66 [FIR] Load Java annotations named arguments properly (see KT-43584) 2020-11-30 13:05:23 +03:00
Jinseong Jeon 77ce5ea15d FIR Java: handle primitive void return type for synthetic setter 2020-11-18 13:06:50 +03:00
Mikhail Glukhikh b658e99f91 FIR Java: simplify flexible nullability manipulations 2020-11-18 13:06:47 +03:00
Jinseong Jeon fc7f589caa FIR Java: record Java types with flexible nullability 2020-11-18 13:06:46 +03:00
Jinseong Jeon 1f48092ec1 FIR Java: convert more annotations to @EnhancedNullability 2020-11-18 13:06:45 +03:00
Denis Zharkov 4c9a4548f2 FIR: Fix overrides binding for Java inheritor
`overriddenMembers` contract requires original (non-enhanced) function
See other usages

Ignored tests have been working accidentally

^KT-43289 Open
2020-11-16 15:50:39 +03:00
Dmitriy Novozhilov 20453bf0d8 [FIR] Get rid of FirSessionProvider.project property 2020-11-13 16:19:29 +03:00
Mikhail Glukhikh 3c48f2eb68 [FIR] Handle isProp/setProp synthetic pair properly in Java use-site scope 2020-11-12 13:37:38 +03:00
Mikhail Glukhikh 2725930460 [FIR] Code cleanup in JavaClassUseSiteMemberScope 2020-11-12 13:37:37 +03:00
Mikhail Glukhikh 22fb620344 [FIR Java] Copy also synthetic setter during enhancement 2020-11-12 13:37:37 +03:00
Mikhail Glukhikh e0abf3a62c [FIR Java] More precise synthetic setter search in use-site scope
In this commit we detect both Java void & Kotlin Unit return types
2020-11-12 13:37:37 +03:00
Denis Zharkov e434a1c892 FIR: Drop unused AbstractFirOverrideScope::create*Copy 2020-11-06 14:44:29 +03:00
Alexander Udalov b3e79d36df Fix compiler warnings and some inspections 2020-11-03 14:00:53 +01:00
Mikhail Glukhikh 2dc6467b5d [FIR] Modify signatures also from ERASED_COLLECTION_PARAMETER_SIGNATURES
In this commit we change value parameter type of containsAll, removeAll,
retainAll from Java collections. Originally it's Collection<?>,
we change it to Collection<T>

#KT-42340 Fixed
2020-10-28 18:09:11 +03:00
Denis Zharkov 2105a041a5 FIR: Optimize usages of containingClass and its implementation 2020-10-28 11:43:25 +03:00
Denis Zharkov 9996c983c9 FIR: Initialize dispatchReceiverType and containingClassAttr for callable members 2020-10-28 11:43:25 +03:00
Mikhail Glukhikh 47a4bd1701 [FIR Java] Look into type arguments during dependent type parameter search 2020-10-23 08:12:17 +03:00
Mikhail Glukhikh 7f3d0af4f7 [FIR Java] Soften rules for matching types for may-be-special-builtins
This commit is workaround for cases like
MyJavaMap<KK : Bound, V> : java.util.Map<K, V>.
After signature changing and substitution we have
MyJavaMap.get(Object) declared and MyJavaMap.get(KK) from supertype,
which can't be otherwise matched as overriding one another.
2020-10-23 08:12:16 +03:00
Mikhail Glukhikh 81529a835b Drop FirAbstractOverrideChecker.isEqualTypes 2020-10-23 08:12:16 +03:00
Mikhail Glukhikh d3e85dbce0 [FIR] Implement replacing Object with type parameters for specials builtins
#KT-42601 Fixed
2020-10-23 08:12:15 +03:00
Mikhail Glukhikh 0e7acd6e8b [FIR Java] Add better type parameter erasure for override matching
Around KT-42601
2020-10-23 08:12:15 +03:00
Mikhail Glukhikh 17de486c23 [FIR Java] Drop nasty code providing type parameter erasure 2020-10-23 08:12:14 +03:00
Jinseong Jeon 46cc01602e FIR2IR: add implicit NOT_NULL cast if needed 2020-10-22 10:51:20 +03:00
Dmitriy Novozhilov 0e47d32587 [FIR] Properly set type of constants for java declarations 2020-10-16 15:24:57 +03:00
Dmitriy Novozhilov e07f63d26c [FIR] Move declaration attributes to declaration builders 2020-10-16 15:24:56 +03:00