Commit Graph

80970 Commits

Author SHA1 Message Date
Ilya Muradyan d40ada5d07 [REPL] Fix syntax errors analysis and incompleteness detection 2021-03-29 18:36:49 +03:00
Ivan Kylchik 736efe0403 [VISUALIZER] Edit black box test to run visualizer on all modules 2021-03-29 18:11:24 +03:00
Ivan Kylchik 097b5a74fb [VISUALIZER] Rewrite black box runner using callback to TestRunner 2021-03-29 18:11:23 +03:00
Ivan Kylchik dbf1f54c3f Add possibility to run callback lambda before dispose test project 2021-03-29 18:11:22 +03:00
Ivan Kylchik 0f70ec032d [VISUALIZER] Add new visualizer tests processing codegen box test data 2021-03-29 18:11:21 +03:00
Ivan Kylchik 427a1295c8 Allow to create sub folders for expected data file that did not exist 2021-03-29 18:11:21 +03:00
Ivan Kylchik 29920d729f [VISUALIZER] Remove unnecessary abstract property frontendFacade
Right frontend facade will be chosen by frontendKind
2021-03-29 18:11:20 +03:00
Ivan Kylchik e19514f1dc [VISUALIZER] Render original symbols/descriptors in fir/psi 2021-03-29 18:11:19 +03:00
Ivan Kylchik 869585870d [VISUALIZER] Rewrite getSymbolId method
For now it is more clear that id means. It is a combination
of package name and class name with additional local path
2021-03-29 18:11:18 +03:00
Ivan Kylchik 6d08ef2f41 [VISUALIZER] Allow to render arrayOf call for fir 2021-03-29 18:11:17 +03:00
Ivan Kylchik 74c19807b8 [VISUALIZER] Replace get with getOrNull to avoid NullPointerException 2021-03-29 18:11:16 +03:00
Ivan Kylchik f32f61a950 [VISUALIZER] Remove all usages of fir native renderer 2021-03-29 18:11:15 +03:00
Ivan Kylchik 30bd39aabf [FIR] Allow to render function type with custom cone type renderer 2021-03-29 18:11:14 +03:00
Ivan Kylchik 13d8b10be0 Extract some cone type utils properties to reuse them in visualizer 2021-03-29 18:11:13 +03:00
Victor Petukhov bbf5c4412e Do subtyping between self types with captured type in special way 2021-03-29 16:30:58 +03:00
Victor Petukhov 7f2c5cde55 Propagate input type position across incorporation properly
^KT-45719 Fixed
2021-03-29 16:17:31 +03:00
Victor Petukhov d06031ece3 Approximate types when only input types check is done. Otherwise given types are inconsistent with types obtained by ResultTypeResolver
^KT-45714 Fixed
2021-03-29 16:17:30 +03:00
Victor Petukhov cc1cb463b2 Remove NonStrictOnlyInputTypesChecks LF and introduce opposite – StrictOnlyInputTypesChecks, set default as strict 2021-03-29 16:17:30 +03:00
Victor Petukhov b60056f11e Turn only input type warning to error
^KT-45482 Fixed
2021-03-29 16:17:22 +03:00
Dmitriy Novozhilov c73c73e85e [Test] Simplify DiagnosticsService 2021-03-29 16:12:29 +03:00
Dmitriy Novozhilov cd890d5833 [Test] Disable UNUSED_* diagnostics in tests which are not belong to contolFlowAnalysis suite 2021-03-29 16:12:29 +03:00
Dmitriy Novozhilov 85949b387e [Test] Explicitly enable UNUSED_* diagnostics in tests which are not belong to contolFlowAnalysis suite 2021-03-29 16:12:28 +03:00
Dmitriy Novozhilov a9ff030c73 [Test] Add ability to configure tests by negative test location regex 2021-03-29 16:12:27 +03:00
Matthew Gharrity 2cb9d1f287 KT-45676: fix backing field annotation resolve 2021-03-29 15:36:05 +03:00
Yahor Berdnikau 6a586fb731 Ensure Android SDK license files always have all license.
Sometime on CI it may happen that file already exists, but does not
contain all required licenses.
2021-03-29 13:59:05 +03:00
Ilya Kirillov 75bf5fdbfe FIR IDE: replace custom KtSymbolModality with compiler Modality 2021-03-29 12:22:20 +02:00
Tianyu Geng 253c389f4a FIR checker: fix failed test files after sync 2021-03-29 12:45:27 +03:00
Tianyu Geng ae902e6fe5 FIR: fix source of callee reference in delegated constructor call
Previously the callee reference of a delegated constructor call is
always the same as the call itself. This violates the contract that no
two FIR elements can have identical sources.  In addition, this sets the
entire call expression as the source of the callee expression.

This change instead sets the proper constructor ref as the callee.

Also fixed EXPLICIT_DELEGATION_CALL_REQUIRED type. It should be an error
instead of a warning.
2021-03-29 12:45:27 +03:00
Tianyu Geng fb14b03824 FIR checker: skip error named reference if receiver is unresolved
Currently, FIR reports errors caused by previous resolution failure. For
example with unresolved `a` and `b` in code `a.b`, both `a` and `b` are
highlighted. FE1.0 only highlights `a` since it's the root cause. This
change applies this heuristics when reporting FirDiagnostics.
2021-03-29 12:45:27 +03:00
Tianyu Geng d6907222cd FIR: pass the qualified access source when reporting ErrorNamedReference
Currently if there is an error in a function call, FIR would report the
entire expression if this call is qualified, but *only* the name if it's
not qualified. For example, assume the following two calls are all
contains some errors.

```
a.foo(1,2,3)
^^^^^^^^^^^^
bar(1,2,3)
^^^
```

The entire call of `foo` is reported since it's qualified. But only the
reference `bar` is reported since it's not qualified. This limits the
usage of position strategies because the IDE does not allow position
strategies to go outside of the initially reported PSI element
(org.jetbrains.kotlin.idea.fir.highlighter.KotlinHighLevelDiagnosticHighlightingPass#addDiagnostic).

This change passes both the original error named reference and the
surrounding qualified access expression and defer the decision of which
to use to the reporting logic.

For unresolved reference and checks on `super` keyword, the position
strategy should not highlight the surrounding parentheses. Hence a new
position strategy `REFERENCED_NAME_BY_QUALIFIED` is added.

In addition, this change also has the following side effect

* some diagnostics are no longer reported when there is a syntax error
  since the higher level structure does not exist when there is a syntax
  error
2021-03-29 12:45:27 +03:00
Tianyu Geng 8805675539 FIR IDE: Enforce an order on subclasses of sealed class
Currently the order is non-determinstic, causing non-determinstic
behavior in the IDE diagnostics. This change enforces an alphabetic
order.
2021-03-29 12:45:27 +03:00
Tianyu Geng c198c57e62 FIR checker: fix diagnostic parameter renderer
Some of the current renderer is fallbacking to `toString` and output the
fully qualified class name with hash code.
2021-03-29 12:45:27 +03:00
Tianyu Geng f38c0cf348 FIR IDE: run FIR highlighting test on all test data
Similarly to FIR diagnostic tests. This commit enable all available test
data and check the reported error messages by FIR. This helps identify
some issues in formatting of FIR diagnostics.

The changes on the test file are mechanically generated. Failed tests
are disabled with `// IGNORE_FIR` and are re-enabled in the second
commit.
2021-03-29 12:45:27 +03:00
Dmitriy Novozhilov 6592407492 [Test] Fix jdk target for BB test 2021-03-29 12:42:54 +03:00
Dmitriy Novozhilov 051e2b0869 [FIR] Update diagnostic test forgotten in dd20dd98 2021-03-29 11:14:53 +03:00
Dmitriy Novozhilov a9399535fb [FIR2IR] Change receiver of field of base class in derived class in property reference 2021-03-29 11:14:52 +03:00
Dmitriy Novozhilov 38ab37d7eb [FIR2IR] Properly handle callable references to static functions 2021-03-29 11:14:52 +03:00
Dmitriy Novozhilov 37db27da58 Add dependency on :compiler:visualizer to generate-all-tests module 2021-03-29 10:25:51 +03:00
Sergey Bogolepov f1280a63d3 Remove -target-cpu flag from Mac targets
Because this option is unsupported in
bitcode embedding.
2021-03-29 12:17:12 +07:00
Mark Punzalan dd20dd9806 Report WRONG_MODIFIER_TARGET on the modifier instead of the declaration
in ExternalFunChecker.

This allows RemoveModifierFix to provide a quickfix to remove it.
2021-03-27 22:27:36 +01:00
Nikolay Krasko c680ee8525 Fix build of benchmarks module
Fix after 998a65d1cb
2021-03-27 17:33:25 +03:00
Tianyu Geng 0d9991ebcd FIR IDE: allow HLDiagnosticFixFactory creating any intention
It seems unnecessary to force all quickfixes to fit the `HLQuickfix`
API, especially for those existing trivial fixes that simply modifies
PSI tree. This change further loosen the API of `HLDiagnosticFixFactory`
to allow it to create arbitrary `IntentionAction` objects. This also
avoids code duplication (for example, specify the family name again in
`ReplaceCallFixFactories`).

`HLQuickfix` and the input/target paradighm can still be used where
applicable.
2021-03-27 13:44:41 +01:00
Tianyu Geng 5609645156 FIR IDE: tweak nullability of applyTo
It looks like `project` can never be null
2021-03-27 13:44:41 +01:00
Tianyu Geng f795a9c4ff FIR IDE: remove type parameter DIAGNOSTIC_PSI
This information is already determined by `DIAGNOSTIC` so there is no
need to repeat it.
2021-03-27 13:44:41 +01:00
Tianyu Geng 6c52d95342 FIR IDE: remove type parameter TARGET_PSI and INPUT
The factory does not need to care about what target PSI and input a
quick fix should need. We only need to ensure these two types match when
an `HLQuickfix` is created. With this constraint loosened, now one
factory can register multiple quickfixes applied on different targets
and different input. This makes it much more flexible when implementing
quickfixes.
2021-03-27 13:44:41 +01:00
Nikolay Krasko a5e445492f Move Bintray js-externals to Space (KTI-528) 2021-03-26 21:08:46 +03:00
Nikolay Krasko b903f87704 Drop kotin/kotlinx and kotlin/kotlinx.html bintray usages (KTI-528) 2021-03-26 21:08:45 +03:00
Nikolay Krasko 998a65d1cb Bump version of kotlinx.benchmark plugin 0.2.0-dev-7 -> 0.3.0 (KTI-528) 2021-03-26 21:08:43 +03:00
Nikolay Krasko 455773299b Minor: investigate j2objc-annotations:1.1 verification trace 2021-03-26 21:08:41 +03:00
Alexander Udalov c17b6c59f8 JVM IR: add isInlineClassType, use it instead of isInlined 2021-03-26 18:57:01 +01:00