Commit Graph

70 Commits

Author SHA1 Message Date
Mikhail Glukhikh 848c2afdb4 "is" over enum entry is now an error + new tests + test fixes 2015-06-30 19:46:30 +03:00
Pavel V. Talanov d2592e4a2c Companion objects have public visibility by default
#KT-7114 Fixed
2015-06-02 16:23:03 +03:00
Mikhail Glukhikh 3c7225e83a An implementation of KT-7753: now enum constructors cannot be called explicitly.
Several tests are provided.
 #KT-7753 Fixed.
2015-05-25 17:27:31 +03:00
Valentin Kipyatkov 7edff172a2 KT-1273 Unused assignment - should highlight assignment instead of expression
#KT-1273 Fixed
2015-05-19 23:45:59 +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
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
Dmitry Jemerov f374eec8f1 deprecating types after colon 2015-04-29 16:33:24 +02: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 5540f09751 Report default object specific diagnostics on 'default' modifier 2015-03-06 19:37:02 +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 48fbce9582 Refactor: process mentions of class object
Rename usages that refer to "default object" concept now
Test data file names are left as is
2015-03-03 20:57:08 +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 7b837e2631 Updata test data: txt files for diagnostics tests 2015-02-16 15:38:36 +03:00
Nikolay Krasko 0f852efb54 LTDA: Don't store illegal 'inner' modifier in descriptors 2014-11-28 17:18:43 +03:00
Andrey Breslav 0eee83b6ec Lazy logs removed 2014-11-21 18:59:45 +03:00
Svetlana Isakova 2a83053355 Updated lazy log tests 2014-11-21 14:02:45 +03:00
Stanislav Erokhin b7c473f59e Update lazy.log files 2014-11-17 17:45:01 +03:00
Pavel V. Talanov d2cfcfa659 Fix test data after changes to renderer and descriptors 2014-11-14 17:09:05 +03:00
Alexander Udalov 4f0d83a7fe Update lazy logs after field rename 2014-11-11 18:35:39 +03:00
Andrey Breslav 4892369cf4 Diagnostic tests are logging their lazy activity 2014-11-10 17:24:04 +02:00
Valentin Kipyatkov 0806de6782 Highlighting ranges should never include comments before/after element 2014-10-31 21:08:52 +03:00
Valentin Kipyatkov f0b93f3de3 Fixed highlighting range for errors in class object 2014-10-31 21:08:52 +03:00
Valentin Kipyatkov c93b78c6dc Fixed diagnostics tests 2014-10-31 21:07:50 +03:00
Alexander Udalov 3a8ad45dec Append newline to EOF for .txt test data files
Reverts and fixes 102f0d3
2014-10-21 03:18:27 +04:00
Alexander Udalov 102f0d3470 Regenerate .txt testData
Add newline to EOF, trim trailing spaces
2014-10-21 00:16:08 +04:00
Alexander Udalov ae401cac0f Prohibit type parameters for enum classes
#KT-5696 Fixed
2014-10-21 00:16:07 +04:00
Alexander Udalov c071ac854e Prohibit all modifiers for enum entries
#KT-2679 Fixed
2014-10-21 00:16:06 +04:00
Alexander Udalov 6ddc063a76 Regenerate test data on enums
Now they have final equals, hashCode and compareTo
2014-10-17 21:27:24 +04:00
Alexander Udalov 624e507ec2 Make enum classes comparable
#KT-3727 Fixed
2014-10-17 21:27:23 +04:00
Alexander Udalov 66a7a58313 Prohibit to override equals/hashCode in enums
#KT-5721 Fixed
2014-10-17 21:27:22 +04:00
Andrey Breslav 6564231040 Descriptor test data for diagnostic tests fixed 2014-10-13 15:38:10 +04:00
Andrey Breslav 12d18533e8 Recursion depth in CommonSupertypes is bounded by maxDepth + 3 2014-10-13 15:37:59 +04:00
Pavel V. Talanov 2ded7bae73 Test abstract override in enum class 2014-10-10 18:19:57 +04:00
Pavel V. Talanov c04b52561e "abstract" modifier on enum class is an error
#KT-3454 Fixed
2014-10-10 17:43:32 +04:00
Pavel V. Talanov 6eae62c235 Do not report NON_FINAL_MEMBER_IN_FINAL_CLASS on open members in enum classes 2014-10-10 17:43:32 +04:00
Pavel V. Talanov 4136c80358 Do not report ABSTRACT_MEMBER_NOT_IMPLEMENTED on enum classes
Partial fix of KT-3454
2014-10-10 17:43:31 +04:00
Pavel V. Talanov e703de5796 Minor: add diagnostic test for entries in enum with abstract members 2014-10-10 17:43:31 +04:00
Nikolay Krasko e796f88b38 Regenerate test data with constructed descriptors for diagnostics tests 2014-09-18 17:58:23 +04:00
Alexander Udalov 5b1993f62a Resolve "values" and "valueOf" in enum class object
Import enum class's static scope into its class object's member scope
2014-09-09 20:42:38 +04:00
Alexander Udalov b52f337f7f Drop enum class object hack
Place valueOf() and values() into the static scope of the corresponding enum
class

 #KT-5580 Fixed
 #KT-2410 Fixed
2014-09-09 20:42:37 +04:00
Svetlana Isakova bc3f6e200a Refactoring in PositioningStrategies
Rename: NAME_IDENTIFIER -> DECLARATION_NAME
NAMED_ELEMENT -> DECLARATION_SIGNATURE
DECLARATION, DECLARATION_OR_DEFAULT (merged) -> DECLARATION_SIGNATURE_OR_DEFAULT
2014-09-01 12:32:53 +04:00
Svetlana Isakova 9d366cb896 Prohibit local objects and enum classes
#KT-5402 Fixed
  #KT-4838 Fixed

Resolve type of object inside local object as special, not supertype('Any').
Changed visibility of constructor of anonymous object to 'internal' to be able to resolve the following:
fun box(): String {
    var foo = object {
        val bar = object {
            val baz = "ok"
        }
    }
    return foo.bar.baz
}
The containing declaration of property initializers is constructor, so 'baz' was invisible inside private constructor.
2014-09-01 12:32:52 +04:00
Svetlana Isakova f811b9541c Position error on 'class A' or 'object A' instead of name identifier only 2014-09-01 12:32:51 +04:00
Alexander Udalov 9e971ed2b9 Minor, add test on enum assignability to kotlin.Enum 2014-08-13 17:19:56 +04:00
Alexander Udalov d78d4bc44c Disallow extension properties with backing fields
#KT-1682 Fixed
2014-05-29 21:24:05 +04:00