We cannot be sure that we won't change behavior of these functions in
some corner cases, so only perform this optimization if the API version
specified by the user is not greater than the compiler's own stdlib
version it was compiled against. This is the same as the similar code in
the old backend in IntrinsicMethods.
Remove sample reference from indexOf(Char) overload: both overloads are on
the same page, and showing the sample for indexOf(String) under indexOf(Char)
is redundant and misleading.
This commit changes XorWowRandom.kt documentation to include a HTTPS link instead of a HTTP link, for security purposes.
This commit also changes the same documentation to reflect the real cycles from the `xorwow` algorithm:
Simple and very fast (125 million/sec), the elements in its cycle of 2^192 − 2^32 easily pass all the tests in Diehard.
Marsaglia, G. 2003. Xorshift RNGs. J. Statis. Soft. 8, 14, p. 5
At last, this commit explicits which part of the code is the implementation of the mentioned algorithm.
Closes KT-35175
Had to edit some bytecodeText tests to account for the fact that JVM_IR
no longer generates explicit initializations for ConstantValue fields,
but NoConstantValueAttributeForNonConstVals is not the default yet.
Before this commit, we used FirAccessorSymbol to emulate synthetic properties.
These symbols were generated in Java use-site scope.
Now, we use synthetic scope instead which is above MemberScopeTowerLevel.
This is more performance-friendly and does not require override matching.
However, accessor symbols should be used in situation when Java accessor
overrides Kotlin property which is broken in this commit
(that's why MapEntry test is corrupted here).
Also, we should not create synthetics for pure Kotlin accessors
(that's why javaAccessorConversion test is corrupted here).
Before this commit, we had two methods to do generally the same synthetic thing.
It's an attempt to keep only one of them.
Accessor symbols are generated in Java use-site member scopes,
at this place we know better whether we are in Java class or not.
However, we have to do this at every use-site level, which is relatively slow.
Also we could encounter problems when accessor function is overridden in Kotlin,
and accessor symbol can still contain reference to Java accessor.
* KT-20357: Add samples for functions related to associate
* KT-20357: Use same fib function for both samples
* KT-20357: Use examples with duplicate keys and simplify examples with primitives
* KT-20357: Use primitive samples for all arrays
* KT-20357: Use String splitting example to better illustrate the use for associate over associateBy with a valueSelector
In case of inline it should be same descriptor (except of fake override), In general case getter could be synthetic accessor and in such case it's not inline