Dmitriy Novozhilov
d01b6ef900
Revert "[NI] Support @OnlyInputTypes annotation. #KT-29307 fixed"
...
This reverts commit 90628112
With that annotation there is complex bug that breaks build of Kotlin compiler
2019-03-18 18:53:38 +03:00
victor.petukhov
70c35f4186
Introduce warning about implicitly inferred Nothing as a type parameter
...
^KT-20849 Fixed
2019-03-15 19:28:38 +03:00
Dmitriy Novozhilov
1c92c22dee
[NI] Add support ExpectedTypeFromCast to new inference. #KT-30405 Fixed
2019-03-15 10:39:29 +03:00
Dmitriy Novozhilov
9062811231
[NI] Support @OnlyInputTypes annotation. #KT-29307 fixed
...
Also KT-26698 fixed in new inference
2019-03-15 10:39:11 +03:00
Alexander Udalov
76aff56b04
Remove unneded parameter of ResolverForProjectImpl
2019-03-11 18:31:59 +01:00
Alexander Udalov
0ccf7345e3
Move JsAnalyzerFacade from ide-common to js.frontend
...
To be used in diagnostic tests now, and as a replacement for
TopDownAnalyzerFacadeForJS in the future
2019-03-11 18:31:59 +01:00
Dmitriy Novozhilov
b681e4bda3
NI. Fix call commonSuperType for 0 types (bug introduced in cbf1d773)
2019-03-07 17:50:30 +03:00
Dmitriy Novozhilov
cbf1d773f7
NI. Coerce return type of lambda function descriptor to Unit. #KT-30242 Fixed
2019-03-07 14:36:09 +03:00
Dmitriy Novozhilov
77c98bef4d
Fix recursion in contract declaration analysis. KT-26386 Fixed
...
Issue fixed only in old inference
2019-03-07 14:35:18 +03:00
Dmitriy Novozhilov
d0462859bf
Minor. Fix reporting diagnostic in contract with callable reference
2019-03-07 14:35:13 +03:00
Mikhail Zarechenskiy
88ee0bf6af
Swap arguments for diagnostic message about incompatible enums
...
This commit is restoring previous behavior changed in c4b69b65 and
fixing `DiagnosticMessageTestGenerated.testIncompatibleEnums` test
2019-03-06 10:44:45 +03:00
Alexander Udalov
d1e33534db
Implement typeOf intrinsic on JVM
...
#KT-29915 Fixed
2019-03-05 18:16:31 +01:00
Alexander Udalov
5d297c40fd
Minor, move ReifiedTypeParameterSubstitutionChecker to PlatformConfiguratorBase
2019-03-05 17:58:10 +01:00
Alexander Udalov
4136fd1dbb
Minor, remove unused parameter of LazyImportResolver.collectFromImports
2019-03-05 16:28:53 +01:00
Alexander Udalov
c069371591
Inline LazyImportScope.selectSingleFromImports
2019-03-05 16:28:52 +01:00
Mikhail Zarechenskiy
c4b69b65bc
Gradually prohibit comparison of incompatible enums
...
#KT-22043 Fixed
2019-03-05 13:33:23 +03:00
Mikhail Zarechenskiy
7c357c0ec0
[NI] Complete calls during one inference session only once
...
The problem is that delegated properties resolve two calls together:
`getValue`/`setValue` with a common receiver, which can contain
callable references. For each completion new anonymous descriptor
was created and caused "rewrite at slice" exceptions later.
Now there is a little hack to check that during one inference session
we don't complete one call more than one time.
More correct fix would be to explicitly specify common receiver for
inference session but it requires quite big refactoring, which will
be done later with a whole refactoring of the common solver
#KT-30250 Fixed
2019-03-05 13:33:22 +03:00
Mikhail Glukhikh
4d19120d84
Don't report "main parameter not necessary" in objects #KT-29414 Fixed
2019-03-04 17:57:52 +03:00
Simon Ogorodnik
4882627712
Make type-system KotlinType-independent
...
- Port NewKotlinTypeChecker.equalTypes
- Decouple new-type transform from isSubtypeOf
- Port isSubtypeForSameConstructor
- Port checkSubtypeForSpecialCases
- Port isSubTypeOf without internals
- Port anySupertype
- Port isSubtypeForSameConstructor, findCorrespondingSupertypes
- Port isSubtypeOfForSingleClassifierType
- Port NullabilityChecker
- Reorder checks for performance
2019-03-04 17:27:45 +03:00
Ilya Chernikov
e99715cf82
Extract extra imports provision into an extension, implement one ...
...
for script in the plugin, drop direct dependency on scripts from
FileScopeFactory
2019-03-02 08:10:17 +01:00
Ilya Chernikov
196e274929
Move calculating dependencies from script sources to plugin
2019-03-02 08:10:16 +01:00
Dmitriy Novozhilov
2f5843f764
Move detecting of illegal call of contract function into call checker
...
(#KT-26153, #KT-26191) fixed
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
54e5cce9be
Prohibit declaring multiple callsInPlace contract on same lambda.
...
#KT-26150 fixed
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
4a7420d77d
Allow declaring contracts on suspend functions. KT-27468 Fixed
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
84da8b6279
Report CONTRACT_NOT_ALLOWED diagnostic on extension property getter/setter
...
KT-27090
2019-03-01 14:50:46 +03:00
Georgy Bronnikov
da13d3288e
Check pre- and postconditions on phases
2019-02-28 11:53:02 +03:00
Alexander Udalov
736ac12374
Prohibit type parameters in class literals in annotation arguments
...
#KT-27799 Fixed
2019-02-26 19:09:42 +01:00
Alexander Udalov
e2106d4d08
Do not assert that function is inline in MemberDescriptor.isInlineOnly
...
This is a more accurate fix of the problem described in 946acd2416
2019-02-26 11:16:01 +01:00
Alexander Udalov
3f1533c35b
Restore support for local class literals in annotation arguments
...
This was broken in c1ab08c8ce where we started to represent KClassValue
as a ClassId of the referenced class + number of times it's been wrapped
into kotlin.Array. Local classes do not have a sane ClassId, so in this
change we restore the old behavior by representing KClassValue with a
sealed class value instead
#KT-29891 Fixed
2019-02-25 19:22:09 +01:00
Yan Zhulanow
24cdd3f857
Remove 'debugTypeInfo' key
...
The key became obsolete as the new evaluator doesn't use it anymore.
2019-02-25 14:43:57 +03:00
Yan Zhulanow
227a7e5609
Provide access to 'coroutineContext' inside suspend functions/lambdas (KT-24829)
2019-02-25 14:43:54 +03:00
Yan Zhulanow
e8c066605b
Do not drop analysis results for the code fragment context, allow to re-use it
...
Otherwise labels declared in the expression context become unresolved.
This is needed for the `this@label` expression evaluation support (KT-28134).
2019-02-25 14:43:53 +03:00
Dmitry Savvinov
50d1c013fc
Force-resolve body in contract computation under lock
...
Even though acquire/release pattern guarantees memory visibility across
threads, it doesn't prevents concurrent access to critical section (i.e.
to force-resolve of the corresponding body).
This can lead to multiple resolution passes over one and the same PSI in
IDE, which, in turn, leads to 'rewrite at slice'-exceptions. See
KT-30030 for case description and details.
^KT-30030 Fixed
2019-02-25 11:10:16 +03:00
Dmitry Savvinov
705ec503cf
Minor optimization: don't put 'null' for ContractProvider in user data
2019-02-25 11:10:16 +03:00
Mikhail Zarechenskiy
617bed1bf1
Fix nested typealiases expansion and as a result fix serialization
...
Consider the following situation:
```
class Inv<T>
typealias A<K> = Inv<K>
typealias B<V> = Inv<A<K>>
fun <U> materialize(): B<U> = TODO()
```
Type `B<U>` is expanding to `Inv<Inv<U>>` and for this type `B<U>` and
`Inv<A<U>>` are abbreviated types, but due to a bug we forgot to make
substitution for `Inv<A<U>>` and were getting abbreviated type
`Inv<A<K>>` where `K` is a type parameter from the typealias declaration.
This bug didn't affect subtyping anyhow but the incorrect type was
serialized and caused problems during deserialization as there wasn't
`K` in deserialization context.
#KT-24964 Fixed
#KT-20780 Fixed
#KT-20065 Fixed
#KT-28236 Fixed
#KT-21775 Fixed
2019-02-25 00:28:45 +03:00
Dmitriy Novozhilov
677987c85f
Add diagnostics on annotations on super types. KT-23992 fixed
2019-02-22 10:28:21 +03:00
Dmitriy Novozhilov
92bd907983
Fix checking repeatablilty of use-site target annotations. KT-26638 fixed
2019-02-22 10:15:37 +03:00
Dmitriy Novozhilov
3e147af3c0
KT-27565 fix
2019-02-22 10:15:16 +03:00
Ilya Chernikov
d1a1594f26
Remove redundant direct usages of the ScriptDefinition in compiler
...
plus some refactoring around definition extraction
2019-02-21 15:59:48 +01:00
Ilya Chernikov
cc4aedb807
Move the rest of script descriptor implementation details to plugin, cleanup
2019-02-21 15:59:48 +01:00
Ilya Chernikov
29fa0f5dff
Replace unnecessary direct usages of the LazyScriptDescriptor with ScriptDescriptor interface
...
lift result property to the interface to implement it
2019-02-21 15:59:48 +01:00
Ilya Chernikov
e28017039d
Split scripts and class/object declarations in DeclarationsProvider
...
simplifies code in most places, avoids filtering in places where they
should be processed independently
2019-02-21 15:59:48 +01:00
Ilya Chernikov
a218455193
Extract script descriptor creation to scripting plugin
2019-02-21 15:59:48 +01:00
Ilya Chernikov
4359919e10
Add package-level class descriptors generation to the SyntheticResolveExtension
...
required for extracting script descriptors generation to an extension
2019-02-21 15:59:48 +01:00
Ilya Chernikov
0839b44ebb
Replace explicit ScriptDescriptor in resolver with appropriate superclass
2019-02-21 15:59:47 +01:00
Dmitriy Novozhilov
f186c83b15
KT-25383 fix
2019-02-21 12:04:23 +03:00
Natalia Selezneva
254374c619
Use ModuleInfo in VirtualFileFinder to add script dependencies in search scope
...
Otherwise it prevent to inline functions from those dependencies during scratch compilation
2019-02-20 18:36:38 +03:00
Dmitriy Novozhilov
5d0074bda5
Fix bug in try/catch resolution in NI
...
Bug was presented in a236ad5
2019-02-18 12:43:42 +03:00
Dmitriy Novozhilov
49a42f9434
Fix #KT-28999. Prohibit type parameters on anonymous objects
2019-02-17 13:02:22 +03:00
Dmitriy Novozhilov
4a298d1413
NI: introduce new data flow analysis for try/catch (#KT-28370)
2019-02-17 12:51:25 +03:00