Commit Graph

171 Commits

Author SHA1 Message Date
Denis Zharkov afd4e644a3 Report warning on usages of non-const vals in places where constants expected 2015-09-23 08:20:57 +03:00
Dmitry Petrov da026f1480 Report errors for annotations with BINARY or RUNTIME retention on file classes. 2015-09-21 12:11:53 +03:00
Dmitry Petrov 7f4ae52517 Generate annotations for single-file classes. 2015-09-21 12:10:40 +03:00
Denis Zharkov 4850fd10f0 Regenerate test data containing rendered descriptors
Introduced '@' after each annotation
2015-09-18 10:14:39 +03:00
Denis Zharkov 38bafaa35c Drop annotations deprecation related things: diagnostics, quickfixes 2015-09-18 09:34:25 +03:00
Mikhail Glukhikh 1667f18d7c Receiver of a safe call is not null inside the call also for extension functions + a pair of tests #KT-9033 Fixed 2015-09-16 15:04:41 +03:00
Alexander Udalov b4470de713 Improve inline diagnostics, report "nothing to inline" on the modifier 2015-09-15 13:11:16 +03:00
Alexander Udalov a946f787bc Fix exception from data class codegen for light classes
EA-66827
2015-09-15 13:11:16 +03:00
Yan Zhulanow 01b2d02196 Remove @get: @set:, reorder remaining annotation targets 2015-09-11 22:32:23 +03:00
Alexander Udalov 3e5c8d1b79 Fix NPE on empty JVM name
#KT-9113 Fixed
2015-09-10 21:44:18 +03:00
Denis Zharkov df97496a16 Deprecate 'kotlin.throws' in favor of 'kotlin.jvm.Throws' 2015-09-10 20:39:05 +03:00
Denis Zharkov 297e9484ba Deprecate decapitalized annotations 2015-09-08 17:50:41 +03:00
Denis Zharkov 676ca86ea4 Deprecate escaped modifiers and unescaped annotations 2015-09-08 12:11:30 +03:00
Mikhail Glukhikh 24252b64d0 Test and fix for NPE in CFA #KT-9078 Fixed #EA-71535 Fixed 2015-09-08 11:31:15 +03:00
Denis Zharkov fc447e2d2f Parse some builtin annotations as modifiers
But still resolve them as annotations.
Mostly it's needed as begin of migration path, one day they become modifiers anyway

Some tests are dropped because they supposed that `annotation` should have parameter
2015-09-08 08:53:35 +03:00
Michael Nedzelsky bc5c9065d2 fix tests in org.jetbrains.kotlin.checkers 2015-09-08 02:04:32 +03:00
Mikhail Glukhikh 8f7b29f80a Annotation rename: target --> @Target 2015-09-07 13:42:26 +03:00
Mikhail Glukhikh eab288bdd7 annotation() now has no arguments. Syntax migration to Retention / Repeatable / MustBeDocumented combination
Deprecated test for annotation(params) completion deleted. A lot of tests changed.
2015-09-04 19:21:12 +03:00
Denis Zharkov 31244edec9 Deprecate deprecated in favor of Deprecated 2015-09-04 18:19:31 +03:00
Denis Zharkov 952d45dc8b Deprecate JVM platform annotations in favor of capitilized themselves 2015-09-04 18:19:31 +03:00
Denis Zharkov 5471a1d18a Add kotlin.external annotation and deprecate kotlin.jvm.native 2015-09-04 18:19:31 +03:00
Stanislav Erokhin 5ded315cbb Improved error reporting for candidates with wrong parameter count 2015-09-01 23:37:42 +03:00
Mikhail Glukhikh 754f8af3fc Type<*> is inferred now if Type<A> and Type<B> common supertype is Type<X> and X is not within parameter upper bound. #KT-7585 Fixed. #EA-68943 Fixed.
It provides also a fix for KT-7585 (empty type intersection assertion).
A set of relevant tests, one fixed test
2015-09-01 15:49:29 +03:00
Alexander Udalov f7a178f978 Report warning on 'Singleton.javaClass'
As a temporary measure before 'javaClass' property is deprecated and removed.
Getting the Java class of a singleton this way is confusing and most of the
time is a failed attempt to get the Java class of a class with a companion
object (e.g. 'Int.javaClass')
2015-09-01 11:36:57 +03:00
Yan Zhulanow 2ce9903356 Fix tests 2015-08-31 15:33:13 +03:00
Alexander Udalov 8d9618348d Move .java and .kotlin extension properties to kotlin.jvm
Delete the old ones in package kotlin.reflect.jvm because otherwise the code
using those functions will become red in a lot less meaningful way (overload
resolution ambiguity) than if they're deleted (unresolved import)

Based on the work originally done by @dnpetrov

 #KT-8380 Fixed
2015-08-27 08:19:50 +03:00
Dmitry Jemerov 4743a69d76 rename platformName annotation to jvmName 2015-08-25 15:40:46 +02:00
Dmitry Jemerov 341f09afd3 rename platformStatic to jvmStatic 2015-08-21 16:59:05 +02:00
Evgeny Gerashchenko 50dbf080f7 Test for KT-2082 Missing 'Unused expression' warning
#KT-2082 obsolete
2015-08-15 12:29:41 +02:00
Denis Zharkov cb7518c3ee Minor. Drop irrelevant field from testData 2015-08-06 08:18:18 +03:00
Mikhail Glukhikh 5b31560808 x?.y is now nullable even if y is Unit + three tests + codegen test fix + source code fix #KT-7936 Fixed #KT-8347 Fixed 2015-08-05 12:26:01 +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
Mikhail Glukhikh dfaed3fef3 Binary or runtime repeatable annotations are not allowed for JVM. Some tests fixed accordingly. 2015-08-03 19:41:45 +03:00
Denis Zharkov 0fba28a8f0 Do not retrieve parent of FQname for root
#KT-8642 Fixed
2015-07-31 17:33:20 +03:00
Mikhail Glukhikh d6406d8d4a Annotation repetition checking with a pair of tests, some old tests changes 2015-07-28 17:13:32 +03:00
Mikhail Glukhikh 94a00540be Targeting / retention for a set of standard annotations, some inapplicable annotation checks replaced with target check, some fixed tests 2015-07-21 15:36:53 +03:00
Mikhail Glukhikh 1309c1f95f Annotation mapper is introduced to map java annotation targets to kotlin targets + a set of new / fixed tests 2015-07-21 15:20:31 +03:00
Denis Zharkov 97af85da9c Change default upper bound of Java type parameters to Any!
#KT-7672 Fixed
2015-07-21 15:16:05 +03:00
Pavel V. Talanov c313887641 Split CompileTimeConstant into two entities
1. ConstantValue
	* just holds some value and its type
	* implementations for concrete constants
2. CompileTimeConstant
	* is only produced by ConstantExpressionEvaluator
	* has additional flags (canBeUsedInAnnotation etc)
	* has two implementations TypedCompileTimeConstant containing a constant value
		and IntegerValueConstant which does not have exact type
	* can be converted to ConstantValue

Adjustt usages to use ConstantValue if flags are not needed
Add tests for some uncovered cases
2015-07-16 02:28:05 +03:00
Mikhail Glukhikh 37b2e97e56 Rendering changed: "annotation class" is now just "class" (with kotlin.annotation.annotation if it's kotlin annotation).
A swarm of tests fixed accordingly.
2015-07-14 16:25:08 +03:00
Mikhail Glukhikh 1eac4d67de "annotation" is now parsed as an identifier. It is no longer a soft keyword.
Sometimes it's allowed to parse "annotation" unescaped even if other annotations must be escaped.
A set of annotations and their options tests.
A swarm of existing tests fixed (mostly kotlin.annotation.annotation() added to txt-files).
STUB_VERSION increased. Some quick fixes slightly changed.
2015-07-14 16:24:55 +03:00
Svetlana Isakova 086e69e132 Added tests for obsolete tasks 2015-07-10 15:05:07 +03:00
Svetlana Isakova 9a5abf368f Constraint incorporation
In a constraint system a new bound is incorporated:
all new constrains that can be derived from it
(and from existing ones) are added
2015-07-10 15:05:04 +03:00
Denis Zharkov 8b49a1d660 Add PurelyImplements annotation
It's parameter is FQ-name of class (currently only from builtins) that added as supertype to annotated Java class.

Parameters of annotated class used as non-flexible arguments of added supertype, that helps to propagate more precise types when using in Kotlin.
Some standard JDK collections loaded as they annotated with PurelyImplements.

See tests for clarification.
Before: ArrayList<Int>.add(x: Int!) // possible to add null
After: ArrayList<Int>.add(x: Int)   // impossible to add null

 #KT-7628 Fixed
 #KT-7835 Fixed
2015-07-09 16:36:47 +03:00
Yan Zhulanow 74f44dddb0 Add tests for publicField 2015-07-07 16:35:23 +03:00
Ilya Gorbunov 1605027b19 Change return type of Char plus Int and Char minus Int binary operations.
JS: Remove unnecessary intrinsic binary operation patterns, adjust intrinsics for binary operations with char.
2015-07-04 04:47:00 +03:00
Ilya Gorbunov 39b27751df Drop deprecated char operations: correct test data. 2015-07-04 04:46:23 +03:00
Mikhail Glukhikh bae9a7d7f8 Types are no more rendered for annotation arguments + a swarm of tests corrected accordingly 2015-07-01 16:12:32 +03:00
Alexander Udalov 3a6ba67602 Delete unused diagnostic about j.l.Class in annotations 2015-06-15 15:55:23 +03:00
Mikhail Glukhikh 46d5290f70 Exception fix (equal returns true for the same types) #EA-65206 Fixed 2015-06-15 14:43:17 +03:00