Commit Graph

87521 Commits

Author SHA1 Message Date
Igor Chevdar f1c1094393 [K/N][optmz] Fix for https://youtrack.jetbrains.com/issue/KT-49234 2021-10-15 14:08:17 +00:00
Mark Punzalan 167dc81d3b FIR/Analysis API: Get parameter name from function type notation or
`@ParameterName` annotation, which is also now added during type
resolution.
2021-10-15 16:19:00 +03:00
Yahor Berdnikau afb68d15d6 Migrate DeterministicBuildIT tests into new test dsl.
^KT-45745 In Progress
2021-10-15 15:04:24 +02:00
Sergej Jaskiewicz 8b2410733f [JS IR] Improve the test for exporting protected members 2021-10-15 12:52:11 +00:00
Tianyu Geng c10879be43 FIR IDE: get type of unresovled super
FIR does not provide any type for unresolved super so we manually
synthesize such types for completion to work.
2021-10-15 14:12:43 +02:00
Yahor Berdnikau a487e91124 Migrate BuildCacheRelocationIT test to new test DSL.
^KT-45745 In Progress
2021-10-15 15:11:23 +03:00
Yahor Berdnikau 031c5f47d9 Populate default settings even when 'build.gradle' file is missing.
^KT-45745 In Progress
2021-10-15 15:11:22 +03:00
Jinseong Jeon c669749915 FIR LC: adapt to split of property annotations during FIR building
As of 7243d308, property annotations are split according to use-site,
and thus, for property accessors and setter parameter, FIR LC needs
to look up accessors and setter parameter with the target use-site.
2021-10-15 13:50:32 +02:00
Svyatoslav Kuzmich 0f66f85cf9 [Wasm] Support main function 2021-10-15 13:58:55 +03:00
Dmitry Petrov af18b10da9 JVM_IR KT-49203 generate stubs for not found classes 2021-10-15 12:15:49 +03:00
Ilya Goncharov 4cca78f8d8 [Gradle, JS] Igore if kotlin_test not found 2021-10-15 11:37:42 +03:00
Viacheslav Kormushkin 86c6ca7f5f [Gradle][Cocoapods] Private Pods with SSH Git Url not allowed in custom specRepos
#KT-48887

Merge-request: KT-MR-4770
2021-10-15 06:36:22 +00:00
Dmitriy Novozhilov 2676de397c Advance bootstrap to 1.6.20-dev-3905 2021-10-15 08:58:16 +03:00
Alexander Likhachev 754595e496 [Gradle, JS] Fix NPM resolution synchronization issues
#KT-49201 Fixed
2021-10-15 00:32:40 +00:00
Mikhail Glukhikh f4067f05a2 FIR: forbid java.lang.String(String) constructor in JvmMappedScope
#KT-49135 Fixed
2021-10-15 01:24:51 +03:00
Mikhail Glukhikh 09bc729b0e FirDefaultParametersResolver: process imported from objects properly
#KT-49083 Fixed
2021-10-15 01:24:51 +03:00
Mikhail Glukhikh c5a4a5de42 Make FirArrayOfCallTransformer recursive #KT-49076 Fixed 2021-10-15 01:24:49 +03:00
Mikhail Glukhikh ad3502a952 Don't refer self function in Fir2IrLazySimpleFunction.initialSignature
This commit prevents stack overflow in MethodSignatureMapper
#KT-49222 Fixed
2021-10-15 01:24:49 +03:00
Mikhail Glukhikh 31db76da56 FIR: fix false positives of INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS
#KT-49129 Fixed
2021-10-15 01:24:47 +03:00
Tianyu Geng e3b92fe5f3 FIR IDE: move helper to shorten refs to IDE 2021-10-15 00:43:20 +03:00
Tianyu Geng 3877dc8cc3 FIR IDE: tolerate comma in when conditions
For invalid code like the following,
```
when {
  true, false -> {}
}
```
`false` does not have a corresponding elements on the FIR side and hence
the containing `FirWhenBranch` is returned by `getOrBuildFir`. This
change makes the analysis API bail out for such cases.
2021-10-14 20:50:50 +02:00
Irene Dea 78ee6b2a09 Extend CandidateInterceptor to intercept ResolvedCallAtom candidate 2021-10-14 18:32:03 +03:00
Artem Kobzar 99688e5c80 test(KT-47096): add tests for the uncovered behavior. 2021-10-14 14:57:35 +00:00
Igor Laevsky 50ca86838f [WASM] Fix build 2021-10-14 17:24:07 +03:00
Igor Laevsky cb5bef1535 [Wasm] Remove unnecessary testHelpers and add assertions from stdlib 2021-10-14 17:24:06 +03:00
Igor Laevsky e331a52e75 [Wasm] Mute/unmute box tests after kotlin.test support 2021-10-14 17:24:05 +03:00
Igor Laevsky bede039c08 [Wasm] Add compiler support for the kotlin.test library 2021-10-14 17:24:05 +03:00
Igor Laevsky 7943298240 [Wasm] Add sorting function to the stdlib 2021-10-14 17:24:04 +03:00
Igor Laevsky 049e48e780 [Wasm] Keep error message for the IAE exception 2021-10-14 17:24:03 +03:00
Igor Laevsky dcdc7e4633 [Wasm] Add box tests for kotlin.test 2021-10-14 17:24:03 +03:00
Igor Laevsky 14eee7c539 [Wasm] Add kotlin-test-wasm library 2021-10-14 17:24:02 +03:00
Dmitry Petrov 6ba65065ee JVM add tests for KT-48544 & KT-49226 2021-10-14 17:23:12 +03:00
Artem Kobzar d2e5523180 test: adapt genericParameterResult.kt test for JS IR backend. 2021-10-14 14:05:39 +00:00
Ilmir Usmanov 559d7015f7 Extend NON_MODIFIER_FORM_FOR_BUILT_IN_SUSPEND diagnostic
to include "suspend fun" token sequence as well
2021-10-14 12:44:18 +00:00
Sergej Jaskiewicz 55ae6d1f3e [JS IR] Optimize pattern-matching of enums into comparing their ordinals
For this code:
```
enum class Season {
    WINTER,
    SPRING,
    SUMMER,
    AUTUMN
}

fun bar1(x : Season) : String {
    return when (x) {
        Season.WINTER, Season.SPRING -> "winter_spring"
        Season.SUMMER -> "summer"
        else -> "autumn"
    }
}
```

previously we generated this:
```
function foo(x) {
    var tmp0_subject = x;
    return (tmp0_subject.equals(Season_WINTER_getInstance())
        ? true
        : tmp0_subject.equals(Season_SPRING_getInstance()))
            ? 'winter_spring'
            : tmp0_subject.equals(Season_SUMMER_getInstance())
                ? 'summer'
                : 'autumn';
}
```

And now we generated this:
```
function bar2(x) {
  var tmp0_subject = x;
  var tmp0 = tmp0_subject._get_ordinal__0_k$();
  var tmp;
  switch (tmp0) {
    case 0:
    case 1:
      tmp = 'winter_spring';
      break;
    case 2:
      tmp = 'summer';
      break;
    case 3:
      tmp = 'autumn';
      break;
    default:
      noWhenBranchMatchedException();
      break;
  }
  return tmp;
}
```
2021-10-14 11:44:01 +00:00
Pavel Kunyavskiy 533eb589cb [K/N] Add tests for static initialisation of ConstantValues 2021-10-14 11:22:28 +00:00
Pavel Kunyavskiy 89414eb214 [K/N] Transform some KProperties to ConstantValue 2021-10-14 11:22:27 +00:00
Pavel Kunyavskiy f03c897dc4 [K/N] Move fields from KFunctionImpl to functions 2021-10-14 11:22:27 +00:00
Pavel Kunyavskiy 7a52ed73de [K/N] Simplify KPropertyImpl 2021-10-14 11:22:27 +00:00
Pavel Kunyavskiy 694864ae76 [K/N] Support kType generation as ConstantValue 2021-10-14 11:22:26 +00:00
Pavel Kunyavskiy 504d72011b [K/N] Transform FunctionReference without bound values to ConstantValue 2021-10-14 11:22:26 +00:00
Pavel Kunyavskiy e4a4cd3e16 [K/N] Transform constant varargs to ConstantValue 2021-10-14 11:22:25 +00:00
Pavel Kunyavskiy 0d11a61fb2 [K/N] Initialize fields with ConstantValue initializers statically 2021-10-14 11:22:25 +00:00
Pavel Kunyavskiy 7a0f72105f [K/N] Support ConstantValue in global analyses 2021-10-14 11:22:24 +00:00
Pavel Kunyavskiy 434d4d2d83 [K/N] Support ConstantValue in autobox 2021-10-14 11:22:24 +00:00
Pavel Kunyavskiy d222e95877 [K/N] Remove unused old buggy intrinsic 2021-10-14 11:22:23 +00:00
Pavel Kunyavskiy e6b9531b6c [K/N] Implement bitcode generation for constant objects 2021-10-14 11:22:23 +00:00
Pavel Kunyavskiy c7f182adbf [K/N] Introduce intrinsic constant constructors 2021-10-14 11:22:22 +00:00
Pavel Kunyavskiy 74b9eeb584 [K/N] Refactor evaluateConst 2021-10-14 11:22:22 +00:00
Pavel Kunyavskiy bf3c343ced Introduce new ir nodes for constant values 2021-10-14 11:22:21 +00:00