Commit Graph

15077 Commits

Author SHA1 Message Date
Andrey Breslav b2ea2e1a15 Prohibit inheritance loops through containing classes
Example

class A : B {
  trait C
}

class B : A.C

Here we have a loop in the hierarchy: A -> B -> A.C => A

"=>" represents class nesting
2014-04-18 21:28:24 +04:00
Andrey Breslav fef2968e1d Order the computations in LazyTopDownAnalyzer
- First, all class descriptors are created
- Then, all functions and properties
- Then the rest
2014-04-18 21:28:24 +04:00
Andrey Breslav b017b87093 Minor. Unused methods removed 2014-04-18 21:28:24 +04:00
Andrey Breslav f58aca5ddf Excluding top-level members of library source files when analyzing them lazily 2014-04-18 21:28:24 +04:00
Andrey Breslav d4eb5e58c5 Minor. Methods made static 2014-04-18 21:28:23 +04:00
Andrey Breslav 5e2630bc12 Unused parameter removed 2014-04-18 21:28:23 +04:00
Andrey Breslav fdc42c6c1d Debugger behavior fixed: backend relies on all relevant files being analyzed, not only one 2014-04-18 21:28:23 +04:00
Andrey Breslav 9da2cbd5e8 Duplicating diagnostics removed from test data 2014-04-18 21:28:23 +04:00
Andrey Breslav f0a29f190b USELESS_HIDDEN_IMPORT diagnostic fixed for LAZY mode 2014-04-18 21:28:23 +04:00
Andrey Breslav a3638eacef Blinking class object tests fixed
Now lazy descriptors for all class objects are retained by the owning class
2014-04-18 21:28:22 +04:00
Andrey Breslav e4e60bc377 Function object replaced by a normal function
+ unneededly public member made protected
2014-04-18 21:28:22 +04:00
Andrey Breslav ebd44816d0 Function object replaced by a normal function 2014-04-18 21:28:22 +04:00
Andrey Breslav 54d3f6df19 Minor. Unused constant removed 2014-04-18 21:28:22 +04:00
Andrey Breslav 1d7bd354d5 Use lazy analysis for highlighting and other purposes 2014-04-18 21:28:22 +04:00
Andrey Breslav 4839f7a230 Make lazy analysis accessible to clients 2014-04-18 21:28:22 +04:00
Andrey Breslav 7d688e5bec LazyTopDownAnalyzer extracted as a separate component 2014-04-18 21:28:21 +04:00
Andrey Breslav 3184b9ddba Special factory method for local analysis
- No need to pass the same flags all the time
- No need to check for local mode when in LAZY mode
2014-04-18 21:28:21 +04:00
Andrey Breslav b02195e9ae LAZY flag is moved to TopDownAnalysisParameters 2014-04-18 21:28:21 +04:00
Andrey Breslav bb87a6bb59 Only create lazy annotations for descriptors from code 2014-04-18 21:28:21 +04:00
Andrey Breslav c57243035e Factory method introduced for TopDownAnalysisParameters 2014-04-18 21:28:21 +04:00
Alexander Udalov cdceaec79f Fix unjustified descriptorToDeclaration in bridge codegen
Delegated and synthesized members don't usually have a declaration as well as
fake overrides
2014-04-18 17:18:51 +04:00
Alexey Sedunov 45073c5a1c Do not show description hint for declaration with diagnostic message
#KT-4815 Fixed
2014-04-18 14:38:20 +04:00
Alexey Sedunov e5777129e2 Introduce utility functions for operations on search scopes 2014-04-18 14:38:19 +04:00
Alexey Sedunov 191ea2533e Dot not lengthen references to declarations contained in the moving element 2014-04-18 14:38:17 +04:00
Alexey Sedunov 5f92c22df3 Smart Selector: Do not suggest expressions contained in the super-expression
#KT-4824 Fixed
2014-04-18 14:38:17 +04:00
Nikolay Krasko 068c9636fc Refactoring: rename TEXT to FQNAMES_IN_TYPES 2014-04-18 13:25:58 +04:00
Nikolay Krasko 962044f887 Use render with short types names in completion lookup elements 2014-04-18 13:18:18 +04:00
Nikolay Krasko f6276cc10b Fix ClassCastExceptions from LocalVariableDescriptor to PropertyDescriptor (EA-55534). 2014-04-18 13:18:18 +04:00
Nikolay Krasko 37c6727413 Report message with context for KT-4464 2014-04-18 13:18:17 +04:00
Alexander Udalov 5e138a606b Report "cannot infer visibility" for delegated members 2014-04-17 19:51:32 +04:00
Alexander Udalov 369472a6e2 Log.warn when descriptors reach TO_STRING diagnostic renderer 2014-04-17 19:51:32 +04:00
Alexander Udalov a5cc894ecd Fix "name in constraint is not a type parameter" diagnostic message
TO_STRING renderer was used for PSI elements, so things like "CLASS", "FUN"
were displayed in the message
2014-04-17 19:51:32 +04:00
Alexander Udalov 72dfca1698 Fix "cannot override invisible member" diagnostic message
Fix "cannot has", delete "in class ..." as it's already present in the message
(function ... defined in class ...)
2014-04-17 19:51:32 +04:00
Alexander Udalov 1deb55bfde Add positioning strategy for diagnostics on illegal fake overrides
"funcitonTypes.kt" test data file was changed because now that there is a
positioning strategy, it takes the liberty of filtering out those diagnostics
that were reported on syntactically invalid elements
2014-04-17 19:51:31 +04:00
Alexander Udalov 146498ec32 Sort out renderers for diagnostics
- change NAMED to be Renderer<Named> and render Named's name. It was used in
  multiple places with arbitrary arguments, not only Named: change renderers in
  those places to TO_STRING
- add STRING, which is Renderer<String> and renders string itself. Change all
  places where strings were used with either TO_STRING or NAMED to STRING
- change NOT_AN_ANNOTATION_CLASS diagnostic to be reported on descriptor, not
  any string
- change "unused variable/parameter" diagnostics to be reported on
  VariableDescriptor, not Object
2014-04-17 19:51:31 +04:00
Alexander Udalov 4c973b79ee Get rid of poorly named NotInferredVisibilitySink
Also make TraceBasedErrorReporter invoke OverrideResolver to report "cannot
infer visibility", because there's some additional logic there
2014-04-17 19:51:31 +04:00
Alexander Udalov 5ae339d940 Fix "Cannot infer visibility" for fake overrides
#KT-4785 Fixed
2014-04-17 19:51:31 +04:00
Alexander Udalov 55b28fcd0e Minor, provide a nicer API in OverrideResolver for plugin 2014-04-17 19:51:30 +04:00
Alexander Udalov 34e7584aec Move some utilities from OverridingUtil to OverrideResolver
OverridingUtil will be present at runtime and we should strive to minimize the
size of our runtime classes

Also add a comment to getOverriddenDescriptors()
2014-04-17 19:51:30 +04:00
Alexander Udalov 3dffd428ad Refactor OverrideResolver and OverridingUtil
Fix warnings, simplify code. Untangle a very complex code related to
diagnostics on multiple default values and different names of parameters in
supertypes; fix a bug there, add test
2014-04-17 19:51:30 +04:00
Alexander Udalov adec89f74d Don't print descriptors' toString() in diagnostic messages
Use DescriptorRenderer.TEXT instead, it doesn't print the debug information
2014-04-17 19:51:29 +04:00
Alexander Udalov 5be2a4945b Render FQ name of default package as "root package" in OverloadResolver 2014-04-17 19:51:29 +04:00
Alexander Udalov 4f9f5d231b Fix incorrect diagnostic message for CONFLICTING_OVERLOADS
- the member and the container were mixed up
- don't output "defined in" part of the message, because we tell later where
  it's already defined in
- fix an instability of the diagnostic order in OverloadResolver by using
  LinkedHashSet
2014-04-17 19:51:29 +04:00
Alexey Sedunov 0d90dcf010 Extract Function: Add test data 2014-04-17 19:01:20 +04:00
Alexey Sedunov 4dec0508a6 ExtractionTest: Change test data layout 2014-04-17 19:01:17 +04:00
Alexey Sedunov 24d8557a5a Translate AbstractJetExtractionTest to Kotlin 2014-04-17 19:01:15 +04:00
Alexey Sedunov a951734ec2 Generalize "Introduce variable" test 2014-04-17 19:01:13 +04:00
Alexey Sedunov 074471c0ed Get rid of unnecessary write action 2014-04-17 19:01:11 +04:00
Alexey Sedunov 6006f53e68 Auto-generate test class for "Introduce variable" refactoring 2014-04-17 19:01:09 +04:00
Alexey Sedunov a72d785d62 Use lazy analysis in JetNameValidatorImpl 2014-04-17 19:01:07 +04:00