Commit Graph

64 Commits

Author SHA1 Message Date
Michael Bogdanov 15eaa15b65 Fix for KT-7421: Unable to inherit from inner class
Fix for KT-6708: Compiler Error when extending open inner class: "java.lang.RuntimeException: Error generating primary constructor of class InnerB with kind IMPLEMENTATION"

  #KT-7421 Fixed
  #KT-6708 Fixed
2015-11-03 10:14:57 +03:00
Michael Bogdanov 65b85711e3 Fix for KT-3335: Creating imported super class' inner class fails in codegen
#KT-3335 Fixed
2015-11-03 10:14:56 +03:00
Michael Bogdanov 9f9217b9c3 Test for obsolete KT-9642
#KT-9642 Obsolete
2015-10-30 09:39:11 +03:00
Dmitry Petrov 8ab55813fe Dropping package facades:
- clashing JVM signature diagnostics should be reported in stable order
- drop tests for clashes vs package facades
- introduce box test for class named as old package facade
- fix some testData
2015-10-19 16:03:19 +03:00
Mikhail Glukhikh 8d88109c00 Underscore names are now forbidden 2015-10-19 15:24:45 +03:00
Mikhail Glukhikh a4af6a3076 data deprecations (empty constructors, non val/var arguments, vararg, superclasses) are now errors, relevant tests fixed 2015-10-19 15:24:28 +03:00
Denis Zharkov bd37a10677 Transform *Array.size to properties 2015-10-16 18:16:02 +03:00
Denis Zharkov 17c906658d Transform Throwable members to properties 2015-10-14 20:39:59 +03:00
Denis Zharkov f0e3fd617d Adjust testData to CharSequence.length transformation 2015-10-14 20:39:35 +03:00
Dmitry Petrov 7e9e427d4c Java 8 rules for method overrides:
- report errors on implementing methods of Any in interfaces
- update testData

~~~

Java 8 override restrictions: interface can't implement a method of 'Any'
- update compiler sources
2015-10-12 14:12:31 +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
Mikhail Glukhikh 6914d09297 Old backing field with dollar is now forbidden 2015-10-09 21:06:26 +03:00
Mikhail Glukhikh fff434d377 data + open / inner / abstract / sealed are now forbidden 2015-10-07 15:13:14 +03:00
Mikhail Glukhikh cba6870f52 protected & internal are now forbidden in interfaces 2015-10-07 11:57:14 +03:00
Denis Zharkov c21d827326 Adjust various testData to size transformation 2015-10-07 08:46:34 +03:00
Dmitry Jemerov 4ca434da54 remove support for 'trait' keyword 2015-09-22 15:00:24 +02:00
Mikhail Glukhikh a1e3471d92 "field": deprecated warnings introduced, compiler tests migrated to the new syntax 2015-09-21 15:48:00 +03:00
Denis Zharkov 9dada595b6 Replace deprecated annotations with modifiers in testData 2015-09-18 10:14:41 +03:00
Mikhail Glukhikh 4bd48c4796 Regular modifier checker implemented (initial version). A set of tests fixed accordingly.
Most of modifier diagnostic is expressed by REDUNDANT_MODIFIER, INCOMPATIBLE_MODIFIERS, REPEATED_MODIFIER, WRONG_MODIFIER_TARGET, WRONG_MODIFIER_PARENT.
A set of modifier diagnostics is not in use now (but not deleted yet).
2015-08-03 19:41:50 +03:00
dnpetrov f364d23ee9 KT-5347 VerifyError on local data class with closure
- generated copy() should push captured fields on stack
- refactor context lookup
- handle vars in local classes using instance fields

 #KT-5347 Fixed
2015-06-25 17:52:30 +03:00
dnpetrov 36ae8790a1 KT-8011 Compiler crashes on attempt to create local class inside lambda
- use StackValue from upper-level context if local lookup fails

 #KT-8011 Fixed
2015-06-18 17:40:24 +03:00
Alexander Udalov 1a3209e1dc Drop traits with required classes
#KT-4771 Rejected
2015-06-17 16:23:58 +03:00
Alexander Udalov 98ce0d529c Fix incorrect 'original' in property accessors
#KT-3930 Fixed
2015-06-17 16:23:56 +03:00
dnpetrov c369949d90 KT-6136 VerifyError on data class inheriting from trait
- coerce property values to proper data class component types
- add tests
 #KT-6136 Fixed
2015-06-16 09:58:03 +03:00
Mikhail Glukhikh 1a312140e9 New enum syntax: Short constructor syntax introduced for entries, optional commas between entries, semicolon after entries. #KT-7605 Fixed.
Grammar changed accordingly.
Semicolons prohibited after an entry except the last one.
Only one initializer is allowed per entry.
EnumReferenceExpression AST node introduced.
Some tests fixed, a pair of new tests written. Kotlin code inside project fixed.
Formatter and intendation tests fixed accordingly.
Stub version is incremented.
2015-05-15 16:13:32 +03:00
Dmitry Jemerov 4bdf598bfe compiler testdata: s/trait/interface 2015-05-12 19:43:17 +02:00
Denis Zharkov 44a55e5bf6 Adjust testData to new labels syntax 2015-04-29 14:03:11 +03:00
Stanislav Erokhin b152211096 Added init keyword to testdata 2015-04-07 13:08:51 +03:00
Dmitry Jemerov 1e536af87e correctly calculate the number of mask arguments required for a method with default arguments
#KT-6816 Fixed
2015-03-27 18:51:07 +01: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 2987e72d29 Do not report redeclaration when outer class and default object's members clash
Previously we prohibited classes and properties with the same name (now it's unnecessary)
Add test for backends that they support qualified (by default object name) member references inside class body
2015-03-11 21:06:05 +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 ffabe19229 Prohibit accessing nested classes/objects of class object using class literal
The fqname of class should be clear from code
Example: can't shorten A.Default.B.Default.C to A.B.C
Also fixes problem when nested class of enum class could be accessed via enum entry
2015-03-03 13:04:29 +03:00
Pavel V. Talanov a1f4c06a49 Update test data that mentioned old JvmAbi constants 2015-02-16 15:38:34 +03:00
Pavel V. Talanov 894c3bceac Test: add jvm backend test for named class object 2015-02-16 15:38:29 +03:00
Alexander Udalov f3b2193afd Delete traces of "jet" in test data and unimportant code 2015-01-13 15:02:16 +03:00
Denis Zharkov 654411a0b0 Refactored tests using Array constructor:
Some moved to tests with stdlib
Some changed to use arrayOfNulls
2014-12-11 16:04:03 +03:00
Stanislav Erokhin fc8cec9509 Create PRIVATE_TO_THIS visibility 2014-12-08 18:24:30 +03:00
Alexander Udalov a7b88e9485 Make CharSequence.length a function instead of property
And String.length as well.

This is done for JVM interoperability: java.lang.CharSequence is an open class
and has a function 'length()' which should be implemented in subclasses
somehow.

A minor unexpected effect of this is that String.length() is now a compile-time
constant (it wasn't such as a property because properties are not supported in
compile-time constant evaluation)

 #KT-3571 Fixed
2014-11-27 20:38:17 +03:00
Alexander Udalov 128c938965 Make Array.size() a function instead of a property
Also add a deprecated extension property to help migration. This is done to
unify getting size of arrays and collections
2014-11-17 15:02:38 +03:00
Svetlana Isakova 8289f13016 Introduced QualifierReceiver instead of PackageType 2014-09-01 12:32:49 +04:00
Alexander Udalov 98ffdb3e32 Minor, delete Object from some test data 2014-07-25 21:19:39 +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 a79398fa00 Don't load Object as a supertype for Java classes
#KT-4890 In Progress
 #KT-5002 Fixed
2014-07-25 21:19:37 +04:00
Alexander Udalov 6210e45fbc Minor, improve test case for KT-1157
Multithreaded version was not working correctly and was throwing NPEs in the
log sometimes
2014-05-29 21:07:34 +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
Alexander Udalov fbf9f5f7d0 Don't generate bridges for equals(), hashCode(), toString()
Otherwise an assertion is failing in the algorithm which is related to an
inconsistency of java.lang.Object inheritance in JDR (KT-4890)
2014-04-24 16:10:12 +04:00
Alexander Udalov f7b6457139 Replace "jet" package name with "kotlin" in testData 2014-03-02 19:55:26 +04:00
Alexander Udalov 3dcd85bdb4 Add toString() to Any, fix all tests
#KT-4517 Fixed
2014-03-02 19:54:49 +04:00
Alexander Udalov 8b918ef1aa Add regression tests for obsolete issues
#KT-1291 Obsolete
 #KT-2895 Obsolete
 #KT-3060 Obsolete
 #KT-3298 Obsolete
 #KT-3613 Obsolete
 #KT-3862 Obsolete
2014-02-13 04:43:53 +04:00