Ivan Kochurkin
6e76978530
[FIR] Consider anonymous objects in FirSuperclassNotAccessibleFromInterfaceChecker
...
^KT-54673 Fixed
2022-11-23 18:29:28 +00:00
Mikhail Glukhikh
3e22f6c052
K2 opt-in: fix reporting of WasExperimental-bound errors
2022-11-23 12:00:08 +00:00
Mikhail Glukhikh
f62bdb0e3d
K1 opt-in: fix message/behavior for future error with WasExperimental
2022-11-23 12:00:08 +00:00
Mikhail Glukhikh
8ddc535caf
Opt-in: forbid/deprecate constructor call with default arguments under marker
...
#KT-55074 Fixed
2022-11-23 12:00:07 +00:00
Mikhail Glukhikh
b92ce68f32
K2 opt-in: restore marker annotation check for constructors
2022-11-23 12:00:07 +00:00
Mikhail Glukhikh
a77750a257
K2 opt-in: drop redundant recursive check for overridables
2022-11-23 12:00:06 +00:00
Mikhail Glukhikh
73cb4d1a6e
K2 opt-in: don't take sub./int. override parent classes into account
...
#KT-54823 Fixed
2022-11-23 12:00:04 +00:00
Artem Kobzar
c1c5933c72
[K/JS] Deprecate old JS-compiler
2022-11-23 11:22:29 +00:00
Dmitriy Novozhilov
eb8ce449e3
[FIR] Don't lose flexible types during capturing from expression
2022-11-22 15:46:22 +00:00
Dmitriy Novozhilov
06e88b559a
[FIR] Consider ConeConstraintSystemHasContradiction as a good reason for DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE error
2022-11-22 15:46:21 +00:00
Dmitriy Novozhilov
9b7b517f43
[FIR] Properly resolve declarations inside contract calls on CONTRACT phase
2022-11-22 15:46:21 +00:00
Dmitriy Novozhilov
01c6c7dc59
[FIR] Properly approximate return type of callable declarations
...
- approximate intersection types in all non-local declarations
- approximate local types in non-private non-local declarations
2022-11-22 15:46:20 +00:00
Dmitriy Novozhilov
991d8c18aa
[FIR] Fix incorrect inference of return type of anonymous functions
...
Also remove incorrect subtype check checkers
Test unsafeVarianceInAliasedFunctionalType.kt started to fail because
of KT-54894. This bug existed before, changes from this commit just
unhided it (previously it was hidden because incorrect subtype check
in `isSubtypeForTypeMismatch` which is used by FirFunctionReturnTypeMismatchChecker
2022-11-22 15:46:19 +00:00
Dmitriy Novozhilov
1b42298025
[FIR] Implement IMPLICIT_NOTHING_*_TYPE diagnostics
2022-11-22 15:46:19 +00:00
Dmitriy Novozhilov
0e84bf2053
[FIR] Don't report ARGUMENT_TYPE_MISMATCH on error types
2022-11-22 15:46:19 +00:00
Dmitriy Novozhilov
07567d6748
[FIR] Always fix type variables with UNKNOWN direction
2022-11-22 15:46:18 +00:00
Dmitriy Novozhilov
1b27d60307
[FIR] Support @OnlyInputTypes annotation
...
^KT-54807 Fixed
2022-11-22 15:46:17 +00:00
pyos
5cc08fb314
FIR DFA: check for reassignments of LHS when handling ?..
...
`x?.y != null` does not imply that `x != null` if e.g. an argument to
`y` has reassigned `x` in the meantime.
The same is true for `x == y` and `functionWithContract(x, y)`, but
those are somewhat harder to implement since there is no easy way to
find the last node of a certain argument.
^KT-55096
2022-11-22 15:44:38 +00:00
pyos
67a6785f63
FIR DFA: move eq/notEq null-to-type translation to LogicSystem
...
This makes the `returns() implies` checker slightly cleaner, and also
fixes the case that I've missed where in RHS of `x ?:` type of `x` was
not set to `Nothing?`.
2022-11-22 15:44:37 +00:00
pyos
ae31275f73
FIR DFA: unwrap transparent expressions in more places
2022-11-22 15:44:35 +00:00
pyos
5b08c300f4
FIR DFA: don't assume != true/false => == false/true
...
This also fixes some returnsNotNull contracts because the old code added
an implication that `== true` => `!= null` then promptly removed any
statement that this could've affected if the argument was a synthetic
variable.
^KT-26612 tag fixed-in-k2
2022-11-22 15:44:34 +00:00
pyos
edaca59d83
FIR DFA: fork flow everywhere
...
In theory, forking persistent flows should be cheap because of object
reuse, so the proposal here is to start from scratch and prove
redundancy of forks on a case-by-case basis. Something something better
safe than sorry.
^KT-28333 tag fixed-in-k2
^KT-28489 tag fixed-in-k2
2022-11-22 15:44:32 +00:00
pyos
757921e63e
FIR DFA: remove exactNotType
...
Literally not used for anything anymore. What a waste of CPU time.
...and safeCallBreakInsideDoWhile is broken again. Oh well.
2022-11-22 15:44:31 +00:00
pyos
6ee6d019ee
FIR DFA: align return-implies checker closer to smartcasts
2022-11-22 15:44:31 +00:00
pyos
1ff968eca2
FIR DFA: extract approveStatementsInsideFlow(variable notEq null)
...
I'm not sure how this fixes a test. Magic!
2022-11-22 15:44:29 +00:00
pyos
6a2d74e211
FIR DFA: generate type implications on all null comparisons
2022-11-22 15:44:28 +00:00
pyos
2ae06a8d46
FIR DFA: when removing a variable, move type statements about dependents
...
val c = C("...")
val d = c
if (c.x == null) return
c.x.length // c.x has type String
d.x.length // d.x -> c.x through d -> c
c = C(null) // remove alias d -> c
d.x.length // info from c.x moved to d.x
^KT-54824 Fixed
2022-11-22 15:44:26 +00:00
pyos
ceb1607057
FIR DFA: when breaking aliasing, keep the rest of the group together
...
var a = ...
var b = a
var c = a
a = ...
// b and c still aliased
2022-11-22 15:44:25 +00:00
pyos
7c8e9ac316
FIR DFA: remove RealVariableAndType
2022-11-22 15:44:24 +00:00
pyos
33363ba1fc
Add more variable aliasing tests
2022-11-22 15:44:23 +00:00
Nikolay Lunyak
c5469d5fb5
[FIR] KT-53988: Report ILLEGAL_SELECTOR for constants as selectors
...
Merge-request: KT-MR-7756
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com >
^KT-53988 Fixed
2022-11-22 10:54:09 +00:00
Anna Kozlova
702d0b4d54
[compiler] missed type parameters in local properties (KTIJ-23583)
...
even though local variables won't contain type parameters,
let's build fir for them
2022-11-22 10:47:45 +00:00
Anna Kozlova
3fdd0aacd3
[compiler] preserve fir receiver in tree
...
when selector is invalid expression,
ensure that fir tree still contains receiver as well as selector
KTIJ-23578
2022-11-22 10:46:59 +00:00
Mikhail Glukhikh
1aae9d6456
FIR2IR: generate this reference to non-source class properly
...
#KT-53983 Fixed
2022-11-22 10:01:16 +00:00
Ivan Kylchik
e3f8aa255a
Fix StackOverflow in interpreter for case with recursive enum init
...
#KT-54884 Fixed
2022-11-21 20:03:18 +00:00
Ilya Kirillov
b6481ed891
[FIR] do not use FirValueParameter for function type parameter
...
As it is a different abstraction, introduced FirFunctionTypeParameter instead
Also, fix syntax checkers for function type parameter
^KT-55035 fixed
2022-11-21 16:17:51 +00:00
Jinseong Jeon
f2bc25c71d
SLC: fix visibility/static modifer of property in companion
2022-11-21 15:55:13 +01:00
Jinseong Jeon
e2901c81ac
SLC: populate fields from companion in annotation
2022-11-21 15:55:12 +01:00
Mikhail Glukhikh
1d76bce3dd
K2: fix outerClassSymbol behavior for local classes #KT-55018 Fixed
2022-11-21 09:23:54 +00:00
vladislav.grechko
5ec2f1ad92
Get rid of redundant boxing when comparing inline class instances
...
^KT-33722: Fixed
2022-11-18 23:14:03 +00:00
Sergej Jaskiewicz
becbc06663
[JS] Re-enable some stepping tests
2022-11-18 10:37:58 +00:00
Mikhail Glukhikh
82f1535007
K1: fix IIOBE in expect-actual checker with different type parameter number
...
#KT-54827 Fixed
2022-11-17 22:28:04 +00:00
vladislav.grechko
36b8ba8df3
Improve support of custom equals in inline classes
...
- Ensure that typed equals parameter's type is a star projection of
corresponding inline class
- Make possible to declare typed equals that returns 'Nothing'
- Forbid type parameters in typed equals operator declaration
^KT-54909 fixed
^KT-54910 fixed
2022-11-17 15:35:14 +01:00
Dmitrii Gridin
33281770c7
[FIR IR] support FirReceiverParameter
...
^KT-54417
2022-11-17 09:50:11 +00:00
Anna Kozlova
c727dbb8ca
[fir compiler] ensure type parameters are included in the resolve scope
...
to resolve the next parameter bounds (KTIJ-23674)
2022-11-16 22:25:02 +00:00
Mikhail Glukhikh
ac514849f4
K1: add deprecation for implicit non-public calls #KT-54762 Fixed
2022-11-16 12:27:12 +00:00
Yan Zhulanow
e21226d02a
[SLC] Ignore callables with invalid or absent names (KTIJ-23584)
2022-11-15 16:13:59 +00:00
Pavel Mikhailovskii
4436ce22b0
Generate meaningful bytecode names for extension receivers in INDY lambdas
2022-11-15 15:38:34 +00:00
Denis.Zharkov
2953e600ff
K1: Deprecate incorrect callable references resolution behavior
...
^KT-54316 Related
^KT-54832 Fixed
2022-11-15 15:06:58 +00:00
Nikolay Lunyak
267ce1d892
[FIR] KT-54220: Don't crash on unsigned integers when no stdlib present
...
^KT-54220 Fixed
2022-11-15 09:02:33 +02:00