Commit Graph

60 Commits

Author SHA1 Message Date
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
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
Alexander Udalov f7b6457139 Replace "jet" package name with "kotlin" in testData 2014-03-02 19:55:26 +04:00
Svetlana Isakova 14cff91fed improved diagnostic message test
added ability to denote required message type (text or html)
2013-10-16 20:41:25 +04:00
Svetlana Isakova 2f02427c57 changed DiagnosticMessageTest
added test arguments to test data
2013-10-16 20:41:23 +04:00
Svetlana Isakova 4666b0f50c refactoring: removed logic of rendering 'expected type mismatch' error from constraint system 2013-10-16 19:51:53 +04:00
Svetlana Isakova 731efd0781 added declared bound constraints directly to constraint system
added status 'hasViolatedUpperBound'
class TypeConstraintsImpl now stores constraint position for each constraint,
so we can filter out bound constraints and find out if the system is successful without them
2013-10-16 19:51:53 +04:00
Svetlana Isakova ae086d883f fixed test after changed type inference error message
changed order or 'found' and 'required' types
2013-09-03 13:09:11 +04:00
Svetlana Isakova 8b7585af66 added diagnostic message tests to ensure that number value types don't appear in error messages 2013-09-02 23:18:43 +04:00
Nikolay Krasko 5ca4df3d1d KT-3618 Missing space in error message "inconstructor"
#KT-3618 Fixed
2013-05-20 17:56:26 +04:00
Mohammad Shamsi 4b656d8c8d KT-3257 Bad diagnostics when trying to instantiate a private class
#KT-3257 Fixed
2013-05-07 13:14:43 +04:00
Michał Sapalski 7deec28b9c Adjusted tests to the new DescriptorRenderer behaviour 2013-04-29 15:44:07 +04:00
Andrey Breslav c422e4194d Reverting pull request 240 2013-04-12 15:25:52 +04:00
Michał Sapalski d875bf80cb Fixed regression in rendering generic types upper bounds. 2013-04-12 12:49:00 +04:00
Michał Sapalski 97796f9b0f Refactoring: use DescriptionRenderer to generate overriding functions / properties. 2013-04-12 12:49:00 +04:00