Commit Graph

566 Commits

Author SHA1 Message Date
Mikhail Glukhikh e8cf0b5d4f Add test for kotlin.streams function usage in Kotlin code
NB: does not pass in javac mode due to lack of JvmPackageName support
2019-10-03 11:16:24 +03:00
Mads Ager 6c7a904663 Psi2Ir: Mark accessors with no bodies as default accessors.
They are currently marked as defined even when they get a
default implementation. That makes it hard to figure out
if the accessor should be removed when introducing a backing
field in the JVM_IR backend.
2019-08-28 19:25:13 +02:00
Alexander Udalov 312205f376 Prohibit synchronized methods on interface members
#KT-9310 Fixed
2019-08-22 18:04:00 +02:00
Mikhail Zarechenskiy 80fa591f10 Fix failing test because of slightly different diagnostics for LV=1.2
There are no `DEBUG_INFO_MISSING_UNRESOLVED` diagnostics for this test
 if one runs it under LV=1.2. These diagnostics are not crucial
 for the test (especially for version 1.2), so use it only with
 the latest stable version

 Plus, reuse test-data to check behavior in new inference
2019-08-21 18:41:13 +03:00
Mikhail Zarechenskiy 6eefea6715 Add tests for obsolete issues
#KT-32395 Obsolete (fixed in 42a5c488)
 #KT-32388 Obsolete (fixed in f3e4c9cd)
 #KT-32271 Obsolete (fixed in 60a0cf1)
2019-07-06 10:06:04 +03:00
Mikhail Zarechenskiy 42a5c488c1 [NI] Fix OnlyInputTypes annotation support for top-level captured types
#KT-32157 Fixed
 #KT-32116 Fixed
 #KT-32235 Fixed
 #KT-32218 Fixed
2019-07-01 12:59:35 +03:00
Mikhail Zarechenskiy a26cf86af7 [NI] Fix exception: callable reference is used with an unresolved LHS
#KT-32187 Fixed
2019-06-25 14:09:38 +03:00
Mikhail Zarechenskiy fe0282809e [NI] Skip fake call for descriptor from object in builder-inference
This call have interesting rules for resolution, see
 `KtQualifiedExpression.elementChain` function and it's usages:
 resolution results for such call can be omitted and be replaced with
 some other information, while diagnostics will be reported from
 builder-inference.

 To mitigate this problem, we'll just skip this call from builder-inference
 as such calls can't have type parameters anyway

 #KT-32094 Fixed
2019-06-21 11:56:09 +03:00
Mikhail Zarechenskiy bebdf6fcef [NI] Added test for KT-32094 2019-06-21 11:52:44 +03:00
Mikhail Zarechenskiy 5cf7c7e5bf [NI] Fix composite substitution for stubbed type in builder-inference
#KT-32038 Fixed
2019-06-18 19:38:04 +03:00
Mikhail Zarechenskiy 4ddd9f081b [NI] Consider explicitly specified type argument as an input type
#KT-31860 Fixed
2019-06-07 12:31:42 +03:00
Dmitriy Novozhilov e574106799 [NI] Support @OnlyInputTypes annotation. #KT-29307 fixed 2019-05-29 10:54:41 +03:00
Dmitriy Novozhilov 0f7e91ff6d [NI] Update testdata for stdlib diagnostic tests 2019-05-29 10:53:34 +03:00
Dmitriy Novozhilov 139497bafb [NI] Add checking @NotNull parameters for candidates 2019-05-29 10:53:07 +03:00
Mikhail Zarechenskiy 8bef345f0f Duplicate test for NI and OI to avoid mismatch of diagnostics
There is a problem with different order of diagnostics for NI and OI,
 so, in order to fix this test, it was duplicated
2019-05-27 17:32:24 +03:00
Mikhail Zarechenskiy cc29ca02f8 [NI] Don't loose inference session during property resolve
#KT-31620 Fixed
2019-05-26 21:31:54 +03:00
Dmitriy Novozhilov ffc0276215 Fix compiler testdata broken in 95544b0 2019-05-23 17:46:16 +03:00
Dmitriy Novozhilov 95544b0970 Add wrappers on KotlinType in EffectSystem
Also that commit removes usages of builtins inside
  effect system and starts refactoring of functor
  composition via composition instead of inheritance.

There are some changes in testdata related to inference of recursive
  functions with implicit return types.

After this commit they all are marked as unresolved. It happens because
  those functions have DeferredType as return type, and computing this
  type produces recursive exception, which provides “typechecker
  recursive problem” diagnostic.

Before this commit, function call was completed successfully, because
  call completer didn’t computed that type, and computation of DeferredType
  were triggered only in `DataFlowAnalyzer.checkType`.
Now, effect system tries to compute that type while wrapping KotlinTypes
  into ESTypes, and effect system itself is triggered in in call completer,
  so, call completion doesn’t finish and function call is marked as unresolved.

#KT-31364
2019-05-23 12:23:22 +03:00
victor.petukhov d4515031de Report warning about implicitly inferred nothing only for return position
^KT-31535 Fixed
2019-05-22 15:45:59 +03:00
Dmitriy Novozhilov 96a3831feb [NI] Add capturing receiver type for callable references
#KT-30292 Fixed
2019-05-16 10:50:30 +03:00
Mikhail Zarechenskiy 516fccbe7b [NI] Complete call if return type contains only "good" type variables 2019-05-08 12:19:52 +03:00
Mikhail Zarechenskiy 61bd3a8d03 [NI] Complete call if return type has proper lower or equal constraints
There was a silly bug: equal constraint is actually a lower and an upper
 constraint, but we checked only presence of lower constraints.

 Test is important as here we have one equal constraint and should
 complete inner call `foo<Int>()` without propagating it to `bar` to
 avoid using `NoInfer` annotation multiple times
2019-05-08 12:19:50 +03:00
Mikhail Zarechenskiy 1fecd15355 [NI] Fix exception on capturing stub type from coroutine-inference
#KT-30853 Fixed
2019-05-06 18:05:02 +03:00
Mikhail Zarechenskiy 1e3db9ee7c [NI] Update test data for diagnostic tests 2019-04-25 16:19:37 +03:00
Dmitriy Novozhilov bfb13803d5 [NI] Fix reporting of overload resolution ambiguity 2019-04-19 14:46:22 +03:00
Dmitriy Novozhilov e70bdb51c5 [NI] Automatically squash equal diagnostics in OI and NI in testdata 2019-04-19 10:53:19 +03:00
Mikhail Zarechenskiy bdab7a88f6 [NI] Add test for obsolete issue
#KT-28658 Obsolete
2019-04-12 15:22:39 +03:00
Mikhail Zarechenskiy a4cbec64b7 [NI] Remove failing codegen tests and add similar diagnostic one
These tests were added for suspend-conversions, it worked only
 with new inference, but implementation was incorrect and had other
 bugs, which were fixed in 1ac25259.
 Support of suspend-conversions will be addressed later with a different
 implementation (#KT-30703)
2019-04-01 01:36:15 +03:00
Mikhail Zarechenskiy 1ac25259e8 [NI] Support callable references to suspend functions
#KT-30658 Fixed
2019-03-29 12:32:01 +03:00
Mikhail Zarechenskiy 017f9aea35 [NI] Builder-inference: fix unresolved reference for variable calls 2019-03-29 12:32:01 +03:00
Mikhail Zarechenskiy d6db1a1b35 [NI] Relax requirement for stub types in builder-inference
For functions with implicit return type annotations will be replaced
 anyway in order to initialize return type, so this restriction in
 `StubType` was too strong

 #KT-30656 Fixed
2019-03-29 12:32:01 +03:00
Mikhail Zarechenskiy b10d19dc78 [NI] Align builder inference with the old inference
#KT-29184 Fixed
2019-03-29 12:32:00 +03:00
Mikhail Zarechenskiy 1eb70ea19e [NI] Update test data related to builder-inference 2019-03-29 12:32:00 +03:00
Mikhail Zarechenskiy b033b9180b [NI] Avoid builder-inference algorithm if types specified explicitly
#KT-30620 Fixed
2019-03-29 12:31:59 +03:00
Dmitriy Novozhilov 1ac3542036 [NI] Decrease priority of Integer Literal Types in type checking
#KT-30446
2019-03-29 11:55:30 +03:00
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 9a2178d96b Split 'nothingTypedSuspendFunction' test into two separate tests (for old and new coroutines) 2019-03-16 21:39:44 +03:00
victor.petukhov 29493a4977 Fix 'nothingTypedSuspendFunction' test after 70c35f4186 2019-03-16 14:15:08 +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 9062811231 [NI] Support @OnlyInputTypes annotation. #KT-29307 fixed
Also KT-26698 fixed in new inference
2019-03-15 10:39:11 +03:00
Dmitriy Novozhilov 0ba163d70b [NI] Fix testdata of inference lambdas with SAM conversions
Tetdata was broken in 3e147af3c0
#KT-27565 related
2019-03-15 10:39:11 +03:00
Alexander Udalov f9be21c935 Report warning on @Synchronized on inline methods
Until KT-27310 is supported, we warn users that this has no effect.

 #KT-29884 Fixed
2019-03-11 18:32:44 +01: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
Alexander Udalov 59fda8d7ce Support JvmPackageName with JvmMultifileClass
This is an internal feature of our standard library needed to compile
new API for unsigned types
2019-03-06 15:34:23 +01:00
Alexander Udalov d1e33534db Implement typeOf intrinsic on JVM
#KT-29915 Fixed
2019-03-05 18:16:31 +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 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
Dmitriy Novozhilov b484e03fa8 Allow use contract function by FQN. #KT-29772 fixed 2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov d1b7c0f683 Fix testdata for try/catch inference and DFA 2019-02-18 12:43:42 +03:00