Commit Graph

3658 Commits

Author SHA1 Message Date
Michael Bogdanov 576ead2afe Test for obsolete KT-3698: Static fields of primitive types and String must be compile-time constants
#KT-3698 Obsolete
2015-05-15 18:06:51 +03:00
Mikhail Glukhikh 4e1a90ee61 Diagnostics for incorrect enum members order, when enum entry follows enum member. A few diagnostic tests.
Now incorrect enum members order is treated as a warning.
2015-05-15 16:13:46 +03:00
Mikhail Glukhikh 983339e1c9 Detection of semicolon between enum entries together with the correct delimiter quick fix for this case.
Error message reported directly on semicolon.
2015-05-15 16:13:41 +03:00
Mikhail Glukhikh 147bca3d22 Enum deprecated syntax detection implemented and integrated into DeclarationsChecker.
A lot of tests was changed to refactor deprecated syntax. Six new tests were added to check deprecated syntax detection.
Diagnostic for "enum entry uses deprecated super constructor": constructor is highlighted
Diagnostic for "enum entry uses deprecated or no delimiter".
One warning removed.
2015-05-15 16:13:34 +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
Mikhail Glukhikh cf741cb868 Enum parsing changed: first entries, then members. Grammar fixed accordingly.
A set of compiler tests and some plugin tests changed accordingly.
Compiler Kotlin code changed accordingly.
2015-05-15 16:13:27 +03:00
Evgeny Gerashchenko 0498bd7739 KT-7587 Overloads are not generated during partial compilation of package
#KT-7587 fixed
2015-05-14 21:51:08 +03:00
Alexander Udalov 2fe05c6f11 Parse and resolve annotations on supertypes 2015-05-14 18:58:08 +03:00
Michael Bogdanov 99cad4b43f Support default method invocation via super
#KT-5970 Fixed
2015-05-13 14:52:18 +03:00
Michael Bogdanov 3fbdf05921 Added some new test for java8 2015-05-13 14:52:18 +03:00
Dmitry Jemerov 4bdf598bfe compiler testdata: s/trait/interface 2015-05-12 19:43:17 +02:00
Dmitry Jemerov 9975bb8935 replace 'trait' keyword with 'interface' in user-visible messages and code generation tools 2015-05-12 11:49:37 +02:00
Michael Bogdanov d6964525b2 Fix for KT-7490: Bad bytecode generated by delegates and lambdas
#KT-7490 Fixed
2015-05-12 12:06:11 +03:00
Alexey Sedunov c4e20b5cc1 Control-Flow: Generate mark instruction before the call/unresolved call instruction
#KT-7663 In Progress
2015-05-11 20:57:56 +03:00
Yan Zhulanow dbc0099e6e Fix usage printing for compiler plugins 2015-05-08 18:19:25 +03:00
Yan Zhulanow 514bc74e9c Support android.support.v4.Fragment classes 2015-05-08 18:19:22 +03:00
Denis Zharkov 93861e16c8 Prohibit non-constant default values for annotation parameter
#KT-7449 Fixed
2015-05-07 22:36:17 +03:00
Denis Zharkov 585a437b2e Parse '@' annotations on enum entries
Just drop truncating builder's creation as we parse only escaped annotations
and will not `eat` entry identifier
2015-05-07 22:36:17 +03:00
Denis Zharkov 849b8acbf8 Replace annotations with brackets in testData
Just in tests that changed after deprecation
2015-05-07 22:36:16 +03:00
Denis Zharkov 5bc7c9600f Deprecate annotations in brackets 2015-05-07 22:36:16 +03:00
Denis Zharkov 1d77f50903 Refine highlighting of '@'
- Do not highlight '@' as separate token.

- Highlight '@' the same way as element where it's located: annotation, label or modifier.

- Extend text range when positioning unresolved reference in annotation with '@'.

Note that currently '@' is collapsed with modifiers tokens
2015-05-07 22:36:16 +03:00
Denis Zharkov b924f35ed3 Resolve annotations on multi-declaration for parameter 2015-05-07 22:36:16 +03:00
Denis Zharkov 3d810ffe61 Parse modifier list of multi-declaration and for parameters 2015-05-07 22:36:16 +03:00
Denis Zharkov 9e23698fe3 Unwrap annotated expression in deparenthesize
It's needed to complete resolved call with annotated function literal
2015-05-07 22:36:15 +03:00
Denis Zharkov 9101505eca Rework deparenthesize-like methods
- Extract private `deparenthesizeOnce` and repeat it until get the same expression

- Drop redundant parameter `deparenthesizeRecursively`

- Drop some usages of `safeDeparenthesize` in `deparenthesize`
  because even if `deparenthesize` returns null (i.e. something was not parsed)
  there is no sense in working with such expressions

Note, that `deparenthesize` now unwraps nested labels' declaration (see changes in testData),
but it seems to be reasonable
2015-05-07 22:36:15 +03:00
Denis Zharkov b72a3de86e Parse annotations on lambda-argument 2015-05-07 22:36:15 +03:00
Denis Zharkov c5af4b42b4 Extract common logic for annotation entries collection
Before this change annotation entries starting with '@' within expressions hadn't been resolved

Note that order of annotation entries in result may change according to order of children in PSI (see changed testData)
2015-05-07 22:36:15 +03:00
Denis Zharkov 7d8351abc6 Implement parsing annotations and modifiers starting with '@' 2015-05-07 22:36:15 +03:00
Denis Zharkov b13e932c3c Parse label reference with spaces before '@'
But still report error
2015-05-07 22:36:15 +03:00
Natalia Ukhorskaya 9108d87a57 Add warning for division by zero:
#KT-5529 fixed
2015-05-07 15:41:37 +03:00
Michael Bogdanov e0aa64b8d2 Support functional expression in non-local returns 2015-05-05 12:47:56 +03:00
Svetlana Isakova 6ee59a06dd Removed obsolete cache for object literals 2015-04-30 21:24:51 +03:00
Svetlana Isakova 02301a0d70 KT-7597 ErrorType leaked into backend
#KT-7597 Fixed
2015-04-30 21:24:51 +03:00
Mikhail Glukhikh f4dd685bbe Fix for a problem with smart cast impossible in a situation when it's not needed. A test for KT-3572. #KT-3572 Fixed. 2015-04-30 16:48:15 +03:00
Denis Zharkov ca8fb53ccd Fix old labels syntax in testData 2015-04-30 10:22:17 +03:00
Denis Zharkov bcee052302 Revert "Temporary parse label definitions with both syntax versions"
This reverts commit 3e3535f8cf.
2015-04-30 10:16:42 +03:00
Dmitry Jemerov ee60ce8369 understand "interface" keyword as synonym for "trait" 2015-04-29 16:50:14 +02:00
Dmitry Jemerov 8258d72e23 don't report USELESS_CAST in case of casting to superype using 'as' 2015-04-29 16:33:32 +02:00
Dmitry Jemerov f374eec8f1 deprecating types after colon 2015-04-29 16:33:24 +02:00
Nikolay Krasko 90cdb19324 Add origin for generated jvm overloads and tweak equals methods to distinguish them
- KT-7586 Strange navigation issue

 #KT-7586 Fixed
2015-04-29 15:20:31 +03:00
Dmitry Jemerov d00b4ca27a update for modern constructor syntax 2015-04-29 14:07:06 +02:00
Dmitry Jemerov f93eeeb563 fix tests by adding missing 'init' keywords to testdata 2015-04-29 14:07:05 +02:00
Dmitry Jemerov 98b8784ab0 drop deprecated syntax for anonymous initializer blocks 2015-04-29 14:07:04 +02:00
Ilya Ryzhenkov 35e82d4574 Propagate annotations when performing substitution on constructors #KT-7608 Fixed
Tests for deprecated warning on generic constructor.
2015-04-29 14:53:40 +03:00
Denis Zharkov fc5236244b Deprecate java.lang.Class as annotation parameter 2015-04-29 14:03:11 +03:00
Denis Zharkov 3e3535f8cf Temporary parse label definitions with both syntax versions
Should be reverted after bootstrap
2015-04-29 14:03:11 +03:00
Denis Zharkov 44a55e5bf6 Adjust testData to new labels syntax 2015-04-29 14:03:11 +03:00
Denis Zharkov 507eefcaa5 Implement new parsing rules for labels
See changes in expressions.grm
2015-04-29 14:03:10 +03:00
Alexander Udalov 0d76634f6b Support SKIP_TXT directive in diagnostic tests
Don't render the whole 'kotlin' package in some tests, because test data will
change every time something is updated in built-ins
2015-04-29 01:36:20 +03:00
Alexander Udalov d7c810a4d0 Copy only nullability/mutability annotations to types
Also don't render copied annotations
2015-04-29 01:09:35 +03:00