Commit Graph

75 Commits

Author SHA1 Message Date
Alexander Udalov df680305ba Improve diagnostic message for UNSUPPORTED_FEATURE
Render lowercase words separated by spaces instead of CamelCase in the
diagnostic message
2016-10-04 10:24:43 +03:00
Dmitry Petrov 06101dba52 KT-13961 REDECLARATION not reported on private-in-file 'foo' vs public 'foo' in different file
Private-in-file declarations conflict with public overload-equivalent declarations
in other files in the same package.

Move functions for grouping possible redeclarations to OverloadResolver
(since they are used only there).

Refactor redeclarations / conflicting overloads reporting.
2016-10-03 11:50:29 +03:00
Denis Zharkov 6663054f4d Fix false positive "Cannot capture" error reporting
There is no need to report an error in case of non-top-level
capture conversion, just don't add relevant capture type in the system instead

If system can be solved successfully without captured type, then it's just fine
(see KT-13950)
In case of contradiction TYPE_INFERENCE_PARAMETER_CONSTRAINT_ERROR is reported

 #KT-13950 Fixed
2016-09-21 18:05:26 +03:00
Mikhail Glukhikh babf61ec19 Minor: message fixed in diagnostics test 2016-09-12 12:57:48 +03:00
Alexander Udalov 83000c50ff Remove quotes around visibility in invisible member diagnostic 2016-07-22 18:13:41 +03:00
Alexander Udalov d8db769823 Use empty list instead of ThrowingList in callable reference resolution
Clients of the call resolution do not expect to see a throwing list in call's
arguments, and it's wrong to make each of them check against the special case
that is the resolution of callable references

Fixes EA-69901
2016-06-07 12:42:45 +03:00
Pavel V. Talanov e397544aee Improve NONE_APPLICABLE ide renderer 2016-02-26 14:45:10 +03:00
Pavel V. Talanov 8cbc9eee3e Improve AMBIGUOUS_CALLS renderer 2016-02-26 14:45:09 +03:00
Pavel V. Talanov 5dcfdb3996 Test return type mismatch on override diagnostic rendering 2016-02-26 14:45:07 +03:00
Pavel V. Talanov 7ba4adf006 Add tests for diagnostics rendering 2016-02-26 14:45:06 +03:00
Pavel V. Talanov 4ab5aabfa0 Adjust existing test data for diagnostic messages 2016-02-26 14:45:06 +03:00
Valentin Kipyatkov 4cd7193047 KT-11018 Ctrl + Mouse Hover shows a var as val
#KT-11018 Fixed
2016-02-13 10:20:20 +03:00
Nikolay Krasko 3f5f892e1b Add html escaping for declaration names in calls (KT-10763)
#KT-10763 Fixed
2016-02-11 02:49:00 +03:00
Dmitry Petrov 4afe98a0f6 Better diagnostics for conflicting overloads.
Skip declarations without sources in reporting, not when determining redeclaration groups:
this allows emitting informative diagnostics for incremental compilation.
Provide containing declaration with "kind", e.g., "package '<root>'", "class A", and so on.
2016-02-03 15:53:07 +03:00
Dmitry Petrov 65f754ffca Fix KT-10764 IDEA doesn't show overload conflict between constructor and function...
When checking for overloads in package, consider functions and top-level class constructors as possibly conflicting between each other. NB OverloadUtil uses containing package scope from module descriptor.

Change diagnostic message for CONFLICTING_OVERLOAD: it's misleading in case of fun vs constructor conflict.

Add custom multifile test for diagnostics in IDE (probably not the best; should preprocess file content if it's required to check highlighting in multiple files, not only in the first file).

Add test for KT-10765 Incremental compilation misses overload conflict between constructor and function ...
2016-02-02 16:21:26 +03:00
Ilya Gorbunov f4822cd757 Fix testData in compiler: add collections and ranges package to fq-names. 2016-01-22 05:54:38 +03:00
Denis Zharkov e9693e987f Humanize type mismatch diagnostic caused by type projections
#KT-10581 Fixed
2016-01-19 11:05:41 +03:00
Alexander Udalov 239502368a Update test data for tower resolution algorithm
- locals win
- unary calls to plus/minus are not supported in favor of unaryPlus/unaryMinus
- unqualified nested classes are temporarily reported as unresolved
- function without receiver win against extension function
- explicit import win against star import
2015-12-11 17:01:02 +03:00
Yan Zhulanow a3ff3ffc45 Fix tests: "Placing function type parameters after the function name" error 2015-11-27 15:51:11 +03:00
Svetlana Isakova 9b440345a1 Do not render @NoInfer, @Exact annotations
For now they are always not rendered,
but later they should be rendered in descriptors, but omitted in error messages
2015-10-16 21:58:45 +03:00
Dmitry Petrov 5d9ee7efee Java 8 rules for method overrides:
- base class method wins against a (default) interface method,
so an abstract base class method should always be implemented
in a derived class;

- interface methods clash regardless of abstract/default
with possibly undefined behavior at run-time,
so a class or interface should always define its own method
for methods inherited from multiple interfaces and not from base class;

- meaningful diagnostics for class inheriting conflicting JVM signatures.
Since no override will happen under Java 8 rules,
ACCIDENTAL_OVERRIDE is misleading for this case;

- update testData.
2015-10-12 14:12:31 +03:00
Denis Zharkov 73799e2c3c Replace deprecated lambda syntax in testData
It's done with similar constructions where possible trying to preserve
intended behavior.
Some usages are removed because they test exactly the feature that
we are going to drop soon.
2015-09-25 08:29:25 +03:00
Michael Nedzelsky 32c66914fe fix tests in org.jetbrains.kotlin.idea.highlighter 2015-09-08 02:05:38 +03:00
Stanislav Erokhin 5ded315cbb Improved error reporting for candidates with wrong parameter count 2015-09-01 23:37:42 +03:00
Stanislav Erokhin 2ee8f1c454 Change outer scope for nested class and object -- removed implicit outer class receiver.
#KT-5362 Fixed
#KT-8814 Fixed
2015-08-18 21:26:42 +03:00
Svetlana Isakova 722a49767a Rename: TypeConstructorMismatch -> ParameterConstraintError 2015-07-10 15:05:12 +03:00
Ilya Gorbunov fb342de451 Ensure stable order is used when rendering list of resolved calls by sorting them with MemberComparator. 2015-05-21 19:07:19 +03:00
Dmitry Jemerov 625096466e IDE testdata: s/trait/interface 2015-05-13 16:13:13 +02:00
Denis Zharkov 6c46606f2b Fix constructors redeclaration message
#KT-6966 Fixed
2015-03-17 23:18:34 +03:00
Pavel V. Talanov 06916d98c6 default -> companion: replace all mentions of default and default object 2015-03-17 15:47:39 +03:00
Pavel V. Talanov 59f192ef90 Replace 'class object' with 'default object' in renderers and test data
Includes changes to decompiled text
Old syntax is used in builtins and project code for now
2015-03-06 19:36:54 +03:00
Pavel V. Talanov cc90891b6c Minor: change rendering of class objects in some diagnostics 2015-03-03 13:04:31 +03:00
Pavel V. Talanov 989f07962b Write to trace in case class qualifier is a short reference to default object
This allows to fix some cases when there is a difference between explicit and short reference to default object
Fix shorten reference, optimize imports and import insert helper for default objects
ShortenReferences always transforms default object references to shorter form for now
Fix DescriptorUtils#getFqName() for default objects (affects test data mostly)
Fix DescriptorUtils#getImportableDescriptor()
2015-03-03 13:04:30 +03:00
Pavel V. Talanov cceb5738c8 Can't omit default object name in imports and types
There should be only one way to denote a type (A.Default.B can't be denoted as A.B)
2015-03-03 13:04:28 +03:00
Alexey Tsvetkov fabcfc7b7f JS: added js() diagnostics tests 2015-02-20 16:01:26 +03:00
Svetlana Isakova 6cac6350a6 Fixed rendering of error message for 'cannot capture type' error
Type variable should be chosen correctly
2015-01-30 13:33:35 +03:00
Alexander Udalov a9a15978e0 Rename jet -> kotlin in idea: completion, debugger, decompiler, highlighter
org.jetbrains.jet.plugin.* -> org.jetbrains.kotlin.idea.*
2015-01-13 01:15:09 +03:00
Svetlana Isakova 2948ca9077 Fixed argument for error message 'TYPE_PARAMETER_AS_REIFIED' 2014-11-21 14:02:43 +03:00
Svetlana Isakova 3a9b7bbade Improved error message for 'nested class should be qualified' 2014-09-07 01:04:00 +04:00
Svetlana Isakova 7f33ad90a6 Report 'nested class accessed via instance reference' error 2014-09-01 12:32:50 +04:00
Alexander Udalov fb958897a9 Introduce kotlin.Cloneable
- Cloneable is a trait with a single protected member 'clone', which is mapped
  to java.lang.Cloneable on JVM
- 'clone' is non-abstract to be able to call 'super.clone()' in the
  implementations. Also if you need your class to be Cloneable, most of the
  time inheriting from Cloneable and calling 'super.clone()' will work
- hack 'super.clone()' in JVM intrinsics and TImpl delegation generation
- make arrays Cloneable, handle 'clone()' calls in the intrinsic

 #KT-4890 Fixed
2014-07-25 21:19:39 +04:00
Alexander Udalov 1706bd4a00 Render the descriptor in "cannot infer visibility" message
Otherwise it's unclear what member is problematic if it's a fake override
(because the diagnostic in that case is reported on the whole class)
2014-05-22 19:32:10 +04:00
Alexander Udalov 9760f30c99 Don't allow fake override to inherit implementation with wrong return type
#KT-4763 Fixed
2014-05-22 19:32:10 +04:00
Svetlana Isakova a57b4f6459 Render inferred and not inferred type parameters
while rendering a resolved call
2014-04-30 13:34:34 +04:00
Svetlana Isakova 4a8255a606 Trace usage in renderer replaced with usage of argument to parameter map 2014-04-30 13:34:31 +04:00
Svetlana Isakova efa00782a4 Reformat html test data for DiagnosticMessageTest 2014-04-30 13:34:30 +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 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 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