Commit Graph

35576 Commits

Author SHA1 Message Date
Ilya Gorbunov 4d6c5bcdcf Split API to separate overloads with radix parameter and without.
Remove unused radix parameter from toFloat and toDouble.
Update public API dump.
#KT-8286, #KT-7930
2016-11-30 02:19:36 +03:00
Ilya Gorbunov ce50c7f13d Fix in test to deal with java 6 not accepting leading plus. 2016-11-30 02:19:33 +03:00
voddan a8bd174cd0 Added tests for parsing with radix.
#KT-8286
2016-11-30 02:19:31 +03:00
voddan 0a939a647f Added optional radix parameter to string-parsing functions: String.toInt, String.toIntOrNull etc.
#KT-8286
2016-11-30 02:19:29 +03:00
voddan 87d010e038 Introduce local dsl for number parsing tests, improve test coverage.
#KT-7930
2016-11-30 02:19:27 +03:00
voddan ce9c981e26 Implemented String.toIntOrNull , String.toLongOrNull.
Rewrote `String.toShortOrNull` and `String.toByteOrNull` by delegating to `String.toIntOrNull`.
Added a regEx check into `String.toDoubleOrNull` to prevent throwing exceptions mostly.
#KT-7930
2016-11-30 02:19:26 +03:00
voddan 3d050322e0 Added String.toIntOrNull, etc
#KT-7930
2016-11-30 02:17:35 +03:00
voddan fb51d21888 Extracted string-parsing extensions and their tests into separate files. 2016-11-30 02:17:35 +03:00
Denis Zharkov fcd9ee037e Support coroutines stack-unwinding in JVM backend
#KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Denis Zharkov 27e4caf046 Temporary disable coroutine tests in JS backend
#KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Denis Zharkov 1f98accad2 Support new suspend convention in JVM backend partially
Stack-unwinding does not work yet

 #KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Denis Zharkov 2c3b0aeddb Add 'suspendWithCurrentContinuation' and 'Suspend' object in built-ins
They are part of the new suspension convention, relevant
support in backends will be added in later commits

 #KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Denis Zharkov a34c9c2580 Support new suspend convention in frontend
#KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Simon Ogorodnik e4a383f3e2 Fix for KT-10665, now only signature + deprecation info shown in quick navigation tooltip
Fix tests, to use full documentation mode instead of quick navigate
2016-11-29 14:08:10 +03:00
Simon Ogorodnik 1c75c02dfe Fix for KT-13699 Quick documentation doesn't show supertype docs for overridden Java 2016-11-29 14:08:09 +03:00
Simon Ogorodnik b93c37faa2 Added tests to prove, that KT-8547 fixed 2016-11-29 14:08:09 +03:00
Simon Ogorodnik 2824c8d4cd Fix for KT-11032 Samples not rendered in Quick Doc
Now samples included as code blocks into quick doc
2016-11-29 14:07:47 +03:00
Simon Ogorodnik 94770f8447 Fix for KT-13197 Markdown indented code blocks are not recognized by quick doc
Expanded code blocks lexer test, to cover indented code blocks
2016-11-29 14:07:34 +03:00
Simon Ogorodnik 3376dbb10d Fix for KT-7995 Quick doc should show deprecation info and ReplaceWith 2016-11-29 14:07:32 +03:00
Simon Ogorodnik 1a211ee7b0 Completion for fqNames in KDoc links
Tests, also proved that KT-14432 are fixed
Added completion and tests for extension functions.
2016-11-29 14:06:54 +03:00
Simon Ogorodnik 62077dafc3 Fix resolving of packages in FQN kdoc links
Assume link [pack.SomeType], pack no more will be marked as unresolved reference
2016-11-29 14:06:51 +03:00
Simon Ogorodnik c93e47febf Feature KT-7739 Type names in Quick Documentation should be clickable and navigate to their documentation
Filter out 'boring builtin classifiers' (kotlin.Int for ex) from signature hyperlinks
2016-11-29 14:06:37 +03:00
Simon Ogorodnik 68d4a7abce Fix for KT-13400, KT-13389 Resolving FQN in quick doc
Problem related to not complete fix in KT-10398
2016-11-29 14:06:35 +03:00
Simon Ogorodnik b007d9b60f Fix for KT-13038 Quick doc should escape HTML entities in code blocks 2016-11-29 14:06:35 +03:00
Dmitry Petrov 2cd6c85cc7 Syntax forms 'a<T>::foo', 'a?::foo' have special cases resolved for future releases.
'a<T>::foo' is reserved if 'a' is a simple name and can be resolved as an expression
(this can be extended to 'a.b.c<T>::foo' case, although that is rather hard to implement using PSI).

 'a?::foo' is reserved if 'a' can be resolved as an expression.
2016-11-29 13:10:01 +03:00
Dmitry Petrov 5d1b848658 KT-14196 Do not allow class literal with expression in annotation arguments 2016-11-29 13:10:01 +03:00
Mikhail Glukhikh 904ea33291 KT-12633 related test fix 2016-11-28 17:32:01 +03:00
Anton Bannykh 159df7964a JS: bound callable references (KT-13573). 2016-11-28 16:33:58 +03:00
Nikolay Krasko dc1e3ae441 Allow to search builtins descriptors in stubs by name 2016-11-28 14:38:34 +03:00
Nikolay Krasko 3537673417 Don't enable search stub declaration by name if file doesn't contain descriptor key
This might cause irrelevant declarations found with the same name.
2016-11-28 14:38:34 +03:00
Nikolay Krasko b816c182f0 Try to avoid loading ast for decompiled files (KT-14804)
#KT-14804 Fixed
2016-11-28 14:38:34 +03:00
Kirill Rakhman 68df8c55e7 Intention "Specify type explicitly" should offer all bounds for platform types #KT-12633 Fixed 2016-11-28 11:21:38 +03:00
shiraji ba92dcb737 KT-14890 Fix the problem with RemoveEmptyClassBodyIntention for nested class followed by a secondary constructor
#KT-14890 Fixed
2016-11-28 11:07:53 +03:00
Dmitry Petrov b7f27b86fe Update golden data for public API test. 2016-11-28 10:23:10 +03:00
Ilya Gorbunov 78a89ef30a Add a hint how to regenerate API dump 2016-11-27 13:50:14 +03:00
Natalia Ukhorskaya d14136b0b6 Debugger: cannot call member extension in an object in Evaluate Expression
#KT-14822 Fixed
2016-11-26 00:20:43 +03:00
Alexander Udalov 204873edf2 Support "-Xno-check-impl" argument, check only real declarations
Use "-Xno-check-impl" to suppress checking whether the platform declaration
implementation has the "impl" modifier.

Do not check presence of fake overrides from platform class in the impl class,
otherwise there would be a lot of errors about the fact that
equals/hashCode/toString are not marked with the "impl" modifier
2016-11-25 20:50:29 +03:00
Alexander Udalov bbafb7c013 Check platform<->impl compatibility for class members
When matching platform and impl classifiers, ensure that each declaration from
the platform class scope is present in the impl class scope.

Note that the presence of the 'impl' modifier is not checked yet
2016-11-25 20:50:29 +03:00
Alexander Udalov 8d3f6f1ce7 Check platform<->impl declaration compatibility
For each platform declaration, there must be at least one impl declaration in
the module with the compatible signature; similarly, for each impl declaration,
there must be at least one platform declaration with the compatible signature.

Note that currently the presence of the 'impl' modifier is not checked yet.

Also, the sad fact is that if you have platform and impl declarations which are
not compatible, you get two errors: on the platform delcaration and on the impl
declaration. This needs to be addressed as well
2016-11-25 20:50:26 +03:00
Alexander Udalov ad59d5a1c8 Define applicability for platform/impl modifiers 2016-11-25 20:50:24 +03:00
Alexander Udalov a3cfd3962c Discriminate 'platform' declarations in resolution
Otherwise calls to functions which are declared twice (platform and impl) would
result in an error "conflicting overloads" in platform-specific modules
2016-11-25 20:50:24 +03:00
Alexander Udalov 926b81fb35 Use DefaultAnalyzerFacade for common code in diagnostic tests
Because of incomplete infrastructure, introduce a few dirty hacks to make
diagnostic tests analyze the common code via DefaultAnalyzerFacade, and also
add common module sources to analysis of platform-specific modules.

Also do not render 'platform' declarations from platform-specific modules to
the .txt file, since they are very likely to be exact copies of the same
declaration in the common module (see RecursiveDescriptorComparator)
2016-11-25 20:50:23 +03:00
Alexander Udalov a4169416ad Support platform modifier in back-ends, add multi-platform integration test
Skip 'platform' declarations completely in back-ends
2016-11-25 20:50:22 +03:00
Alexander Udalov c1eebacd55 Do not render declarations from other modules in diagnostic tests
Because PackageViewDescriptor may consist of several package fragments from
different modules (see LazyPackageViewDescriptorImpl#fragments), we now filter
out fragments from irrelevant modules before rendering them into the .txt
2016-11-25 20:50:21 +03:00
Alexander Udalov a8bd82e863 Support only simple declarations for 'impl' type aliases
E.g. 'impl typealias Foo<A, B> = Bar<A, B>' is allowed; everything else
(variance, changing order of parameters, etc.) is pretty much disallowed.

This is done for simplicity: otherwise matching the platform/impl class scopes
would be not so straightforward
2016-11-25 20:50:20 +03:00
Alexander Udalov 751949db69 Support platform/impl modifiers for classes
Do not report "unused parameter" for parameters of platform declarations. Do
not allow platform class constructors to have val/var parameters or have an
explicit delegation call to another constructor. Do not allow platform classes
to have 'init' blocks.

Also suppress the "supertype not initialized" error for platform classes: the
supertype should be initialized in the impl class
2016-11-25 20:50:19 +03:00
Alexander Udalov ce9691cd2b Support platform/impl modifiers for properties
Do not allow platform properties to have backing fields, initializers, be
delegated, lateinit or const, or have accessors with bodies
2016-11-25 20:50:18 +03:00
Alexander Udalov af1264a46d Support platform/impl modifiers for functions
Also add a new capability for ModuleDescriptor, which is used to obtain the
platform in the multi-platform scenario in tests.

Suppress the following errors for platform functions: "function has no body"
and "nothing to inline". Also do not report redeclaration between platform and
non-platform functions because this is the case when the common +
platform-specific code are analyzed together.

Note that some diagnostics reported in tests are not yet implemented in this
commit, they appear in subsequent commits
2016-11-25 20:50:17 +03:00
Alexander Udalov 6e2ef9b1d2 Add platform/impl soft keywords, add isPlatform/isImpl to MemberDescriptor 2016-11-25 20:50:17 +03:00
Alexander Udalov 0dc31af73d Introduce KotlinMetadataFinder#hasMetadataPackage
Before creating a MetadataPackageFragment, check that the corresponding
directory (across the classpath) contains at least one .kotlin_metadata file.
Otherwise we're creating packages for every simple name queried during the
resolution and sometimes prefer a (empty) package to the existing class, for
example when the latter class is star-imported
2016-11-25 20:50:15 +03:00