Commit Graph

15937 Commits

Author SHA1 Message Date
Alexander Udalov 5fdb9e6218 Change logic of loading "suppress" annotation class descriptor
Instead of loading the descriptor and checking equals(), we now check if the
annotation is in fact "suppress" by simply comparing its FQ name. This allows
us to suppress warnings while compiling built-ins: the problem is that
built-ins have its own "suppress" annotation class (defined in the sources)
which differs from the one loaded by the compiler (from kotlin-compiler.jar)
2014-05-19 19:50:58 +04:00
Alexander Udalov 5488a8402f Move and rename KFunctionImpl classes
Move from package "kotlin.reflect" to "kotlin.reflect.jvm.internal". They are
internal detail of the compiler and should not be used directly (especially now
that "kotlin.reflect" is in default import paths).

Also rename "KFunctionImplN" to "KFunctionNImpl", because this name makes more
sense
2014-05-19 19:50:58 +04:00
Alexander Udalov de8b2b3668 Fix generic signature for SAM adapters and constructors
SAM-related code in codegen was using JavaClassDescriptor directly, which has
an erased signature. Create and use a new abstraction SamType which has a full
generic signature of a type which was used in the SAM construct
2014-05-19 19:50:58 +04:00
Alexander Udalov 51a16fe491 Drop FunctionImplN and ExtensionFunctionImplN
We have FunctionImpl and ExtensionFunctionImpl classes now (2 classes, not 46)
2014-05-19 19:50:58 +04:00
Alexander Udalov 41eb0deaa0 Introduce FunctionImpl and ExtensionFunctionImpl classes
Old FunctionImpl0,1,2,... will be dropped since they had no purpose
2014-05-19 19:50:58 +04:00
Alexander Udalov 845e3323f9 Create error type if reflection class isn't found
Introduce a new diagnostic fired when reflection types aren't found in the
classpath
2014-05-19 19:50:57 +04:00
Alexander Udalov 9503056dd5 Add default import "kotlin.reflect" 2014-05-19 19:50:57 +04:00
Alexander Udalov 0c2c203e96 Move KFunctionN classes to package "kotlin.reflect" 2014-05-19 19:50:57 +04:00
Alexander Udalov 3dc92c209f Don't compile Java sources of built-ins
Module 'builtins' no longer has (and is not supposed to have) Java sources
2014-05-19 19:50:57 +04:00
Alexander Udalov c7a7f31e82 Introduce module 'reflection', move KFunctionN to it
Metadata for KFunction classes is now longer serialized along with built-in
classes. This effectively means that it's no longer possible to find KFunction
classes via dependency on built-ins. There should be a kotlin-runtime library
in the specified classpath for reflection types to be resolvable.

A lot of tests were moved and changed, because tests on callable references
require stdlib in classpath from now on
2014-05-19 19:50:57 +04:00
Alexander Udalov c1cd8bf069 Use module instead of KotlinBuiltIns in ReflectionTypes 2014-05-19 19:50:56 +04:00
Alexander Udalov 357fe5cb17 Pass module to GenerationState
- get rid of a hack there which was used to obtain any module, to be used in
  ReflectionTypes
- delete unused getError() in LightClassConstructionContext which was always
  null
- fix some minor warnings
2014-05-19 19:50:56 +04:00
Alexander Udalov b27b8bf8b2 Extract DescriptorUtils.getContainingModule() 2014-05-19 19:50:56 +04:00
Alexander Udalov a26ed665d9 Don't log stack trace for warning
These stack traces are confusing and create a feeling that an exception was
thrown
2014-05-19 19:50:56 +04:00
Alexander Udalov 972ef525ed Regenerate tests 2014-05-19 19:48:30 +04:00
Alexander Udalov 7b21c5c8c3 Fix .gitignore
Specific paths needs to be excluded only from the root directory. Otherwise you
couldn't for example create a directory named 'dependencies' somewhere in tests
2014-05-19 19:45:55 +04:00
Andrey Breslav 7bce9060e2 Better handling of PackageTypes in KotlinBuiltIns 2014-05-19 19:28:14 +04:00
Andrey Breslav a05c8a3d96 Minor. Duplication eliminated 2014-05-19 18:56:38 +04:00
Andrey Breslav 38954fc2ba Utility method used instead of manual creation of an injector 2014-05-19 18:56:38 +04:00
Andrey Breslav f72dcb8ee2 Fix for EA-53605 - UOE: PackageType.throwException 2014-05-19 17:02:18 +04:00
Andrey Breslav 8885d5709e Private inside a package should be visible only inside this package in the same module 2014-05-19 13:02:25 +04:00
Andrey Breslav 9983a567d4 Multi-module diagnostic tests supported
Test added for internal visibility
2014-05-19 13:02:25 +04:00
Andrey Breslav 236f38a26b Support modules in multi-file tests 2014-05-19 11:39:37 +04:00
Andrey Breslav 0ccb82344d Error message fixed 2014-05-19 11:39:36 +04:00
Zack Grannan 42f186b33f Added String Concat -> Interpolation Intention (KT-4750) 2014-05-16 19:00:25 +04:00
Mikhael Bogdanov 380f1875b8 Don't generate default method implementation in package facade (just delegation) 2014-05-16 18:34:07 +04:00
Nikolay Krasko 391d40e792 Fix error alignment for binary expression parts 2014-05-16 17:10:04 +04:00
Nikolay Krasko d4ddf06ebd Fix problem with alignment in assignments and other binary expressions 2014-05-16 17:10:04 +04:00
Nikolay Krasko 356cb80e7f Indent for multideclarations 2014-05-16 17:10:03 +04:00
Nikolay Krasko b958e0d6b8 Allow empty blocks for classes and function literals 2014-05-16 17:10:02 +04:00
Nikolay Krasko 3d588acd2d Add space between 'when' and '(' 2014-05-16 17:10:02 +04:00
Nikolay Krasko 6b8ab1a604 Minor: remove warning 2014-05-16 17:10:01 +04:00
Nikolay Krasko 9eb2615ac3 Don't remove linebreak after smb. else's statement } 2014-05-16 17:10:00 +04:00
Nikolay Krasko 8eb8e5a928 Fix spacing after return (KT-4947)
#KT-4947 Fixed
2014-05-16 17:10:00 +04:00
Nikolay Krasko 3f96b4775f Better indententation on enter in lambdas 2014-05-16 17:09:59 +04:00
Nikolay Krasko 109f7992b4 Format functions with function literal arguments (KT-2934)
#KT-2934 Fixed
2014-05-16 17:09:58 +04:00
Nikolay Krasko eeea34ec9e Refactoring: rename class 2014-05-16 17:09:58 +04:00
Nikolay Krasko 47400f90ce Refactoring: rename method, extract method, static import 2014-05-16 17:09:57 +04:00
Nikolay Krasko 2b847cd885 Formatting enum delegations lists 2014-05-16 17:09:57 +04:00
Nikolay Krasko 5839fda22f Fix recovery in enum initializers 2014-05-16 17:09:56 +04:00
Nikolay Krasko ad0e6dadf4 Minor: code clean up 2014-05-16 17:09:55 +04:00
Nikolay Krasko 650a3533f1 Refactoring: use extension functions to modify API 2014-05-16 17:09:55 +04:00
Nikolay Krasko 2a693bcada Formatting index calls 2014-05-16 17:09:54 +04:00
Nikolay Krasko cd3aa06a83 Fix 'In multiline class declaration the indent before parent's name is destroyed' (KT-3848)
#KT-3848 Fixed
2014-05-16 17:09:53 +04:00
Nikolay Krasko 850987748e Fix 'Formatting after braceless class declaration' (KT-3858)
It's irrelevant that element is incompleted when new node is being add to the middle

 #KT-3858
2014-05-16 17:09:53 +04:00
Nikolay Krasko 5e50b98103 Fix comment to KT-3370 about no formatting of spaces around colon in objects
#KT-3370 Fixed
2014-05-16 17:09:52 +04:00
Nikolay Krasko 17699f7f0e Fix 'Formatter doesn't remove redundant spaces between modifiers, name, and opening brace'
#KT-3370 Fixed
2014-05-16 17:09:52 +04:00
Nikolay Krasko d49d42a409 Add spaces around elvis operator 2014-05-16 17:09:51 +04:00
Nikolay Krasko 45013ce8af Fix formatting for multiline binary expressions
#KT-4797 Fixed
2014-05-16 17:09:50 +04:00
Nikolay Krasko 055859888e Refactoring: class rename with minor code enhancements 2014-05-16 17:09:50 +04:00