Commit Graph

27 Commits

Author SHA1 Message Date
Alexander Udalov
e8a8bdc58e Add test on cyclicly dependent Java 9 modules 2017-07-06 13:01:12 +03:00
Alexander Udalov
f8346d21c2 Check type alias expansion for Java 9 module accessibility
#KT-18598 In Progress
2017-06-29 15:59:57 +03:00
Alexander Udalov
8768500844 Fix incorrect behavior and refactor JvmModuleAccessibilityChecker
Previously we assumed that a symbol is accessible if its containing
package is exported by module-info.java. Which was obviously wrong and
could lead to a situation where a symbol would be incorrectly accessible
if a usage module has a dependency on the symbol's module in IDEA
project terms, but does not require it in its module-info.java

 #KT-18598 In Progress
2017-06-29 15:59:57 +03:00
Alexander Udalov
e32880d9a3 Implement Java 9 module visibility checks
In this commit, only IDE tests are added, because we look for module
declarations in the IDE across the whole project, whereas in the
compiler we should do this on the module path only and that requires
separate work (KT-18599) which is done in the following commits.

(The change in Cache.kt is needed so that
JvmModuleAccessibilityChecker.ClassifierUsage, which is an inner class,
would be injected properly.)

 #KT-18598 In Progress
 #KT-18599 In Progress
2017-06-29 15:59:56 +03:00
Pavel V. Talanov
8fc953f529 Modules with different language levels can't be analyzed together
"Supports additional builtIn members" setting
    is basically adding members to some types
If we analyze them toghether other modules would leak types
    that have those members (or don't) into other modules scopes
    leading to code that has erroneous highlighting

See KT-17357

#KT-17357 Fixed
2017-05-22 17:42:21 +03:00
Pavel V. Talanov
55721e4f16 Test not creating resolvers for modules that have no relevant packages 2017-05-16 22:15:06 +03:00
Mikhail Glukhikh
0798e43524 Consider only source-compatible modules in allImplementingModules use-sites
So #KT-17400 Fixed
So #KT-15680 Fixed
So #KT-15660 Fixed
Likely also #KT-16838 Fixed
2017-05-02 19:01:31 +03:00
Mikhail Glukhikh
04f7ba95c5 Add module name to HEADER_WITHOUT_IMPLEMENTATION message 2017-05-02 14:17:20 +03:00
Alexander Udalov
ea727ff3f0 Use header->impl mapping in HeaderImplDeclarationChecker.areCompatibleTypes
Construct a special TypeCheckingContext that is aware of the magic
behind the "impl typealias" that implements a "header class"

 #KT-16986 Fixed
2017-04-20 22:33:25 +03:00
Alexander Udalov
9a8dc14616 Do not add JS/JVM libraries to common library dependencies in LibraryDependenciesCache
Currently kotlin-stdlib-common doesn't have serialized built-ins inside,
so in a multiplatform project, it was possible that either JVM or JS
built-ins (depending on the order of entries in the project
configuration) were going to be used for the analysis of a common module
depending on kotlin-stdlib-common. This resulted, for example, in
additional built-in member calls (e.g. "List.stream()") being unresolved
in JVM modules when they used the List instance coming from the common
module (see the added test)
2017-04-18 22:58:56 +03:00
Alexander Udalov
7fe9b99087 Support different target platforms for modules in AnalyzerFacade
Instead of reusing the same AnalyzerFacade that is used for resolution
of a module to resolve its dependencies, analyze each dependency
module/library with a facade depending on its target platform. Introduce
and use CommonLibraryDetectionUtil in addition to
KotlinJavaScriptLibraryDetectionUtil, to detect common libraries (with
.kotlin_metadata files).

Note that before multi-platform projects, this was not needed because
there were only two platforms (JVM and JS), and JVM module had only JVM
modules/libraries as dependencies, JS module had only JS
modules/libraries as dependencies. Now, for example, a JVM module can
have a common module/library as a dependency, and it would be incorrect
to analyze that dependency with JvmAnalyzerFacade because that facade
does not know anything about .kotlin_metadata files.

The changes in Dsl.kt and KotlinCacheServiceImpl.kt are needed because
PsiElement.getJavaDescriptorResolver, called from some IDE code, started
to fail on a common module, because the container for a common module
does not have the JavaDescriptorResolver
2017-04-14 00:44:00 +03:00
Alexander Udalov
722687acd6 Refactor multiplatform test cases in MultiModuleHighlightingTest
Groupt multiplatform test cases in a nested class, get rid of duplicated
code, rename "header" -> "common" where it relates to the common module
2017-04-14 00:43:59 +03:00
Mikhail Glukhikh
b0a333456e Platform header IDE annotation: do not report suppressed error #KT-15601 Fixed 2017-01-11 18:37:44 +03:00
Mikhail Glukhikh
76ee6d7712 Minor: multi-platform highlighting tests rename 2017-01-11 18:37:38 +03:00
Mikhail Glukhikh
5947d49dee Multi-platform fix: no more errors for top-level impl fun / val / var in IDE 2016-12-19 14:55:49 +03:00
Mikhail Glukhikh
3540bc008b Build fix: testPlatform3 from MultiModuleHighlightingTest 2016-12-15 11:07:33 +03:00
Mikhail Glukhikh
052a5033b5 PLATFORM_DECLARATION_WITHOUT_DEFINITION rendering changed (platform is included into diagnostic text now) 2016-12-13 19:06:08 +03:00
Mikhail Glukhikh
7649232f86 Platform header annotator: implementation + simple multi-platform highlighting tests #KT-14905 Fixed 2016-12-13 19:02:23 +03:00
Alexander Udalov
83000c50ff Remove quotes around visibility in invisible member diagnostic 2016-07-22 18:13:41 +03:00
Alexander Udalov
b6b2303aa7 Improve error message for inaccessible invisible_fake members
#KT-8989 Fixed
2016-07-22 18:13:40 +03:00
Denis Zharkov
5bc5722051 Load additional JDK functions into built-ins member scope
#KT-5990 Fixed
 #KT-7127 Fixed
 #KT-10370 Fixed
2016-04-25 17:41:08 +03:00
Zalim Bashorov
073b10072a Minor: fix testdata 2015-10-01 14:57:26 +03:00
Michael Nedzelsky
ea11133142 strict checking for internal visibility 2015-09-08 19:00:45 +03:00
Denis Zharkov
89337ff51e Change deprecation rules for annotations in brackets
Also adjust quickfix for deprecated syntax
2015-05-20 09:24:56 +03:00
Pavel V. Talanov
54799b1a34 Internal visibility works the same as public
Fix test data
This change is needed to preserve old behaviour for M9
isFriend() utilities become unused after this change
2014-09-26 22:06:32 +04:00
Pavel V. Talanov
88b262faf1 Make test source module a friend of production source module 2014-09-12 13:08:31 +04:00
Pavel V. Talanov
d6bd4535fa Introduce MultiModuleHighlightingTest
Checks that analysis produces expected diagnostics when configured by real IDEA module
2014-08-22 22:59:03 +04:00