Commit Graph

10726 Commits

Author SHA1 Message Date
Alexander Udalov d40906a690 Disallow references to extensions in classes
It's not clear in which order should the two receiver arguments be passed to
them, and there's no corresponding K*FunctionN class for now

 #KT-1183 In Progress
2013-04-22 17:59:31 +04:00
Alexander Udalov c4b4fa750c Resolve callable reference expressions
#KT-1183 In Progress
2013-04-22 17:59:31 +04:00
Alexander Udalov 1db026aac5 Add CheckValueArgumentsMode to call resolver
Now it's ENABLED everywhere. DISABLED will be used for resolving callable
reference expressions, since there won't be any arguments near the function
call to check

 #KT-1183 In Progress
2013-04-22 17:59:30 +04:00
Alexander Udalov 1d07068c7c Minor refactoring in CallExpressionResolver
Kill useless parameters
2013-04-22 17:59:30 +04:00
Alexander Udalov 77ef20a51e Generate KFunction/KMemberFunction/KExtensionFunction
#KT-1183 In Progress
2013-04-22 17:59:30 +04:00
Alexander Udalov b343e94ea5 Refactor GenerateFunctions
Extract some methods && constants, inline some useless methods, replace
PrintStream with PrintWriter, make some methods non-static
2013-04-22 17:59:30 +04:00
Alexander Udalov dac0d77e90 Parse simple callable reference expressions
#KT-1183 In Progress
2013-04-22 17:59:30 +04:00
Alexander Udalov a6e242d166 Add new token COLONCOLON (::) for callable reference
#KT-1183 In Progress
2013-04-22 17:59:30 +04:00
Alexander Udalov d566250b18 Introduce JetCallableReferenceExpression
Reuse the obsolete hash qualified expression as a newly born callable reference
expression: Foo::bar. It's not a qualified expression anymore, since the
receiver part is now a JetTypeReference and it also can be empty ("::bar")

 #KT-1183 In Progress
2013-04-22 17:59:30 +04:00
Alexander Udalov b7671d8af2 Delete unused method
It was only used in parsing tuples, which are dropped
2013-04-22 17:59:30 +04:00
Alexander Udalov 76fa9642f0 toString() for FunctionN classes
It's implemented as if the types were reified: getting the real type parameters
of the corresponding FunctionN class
2013-04-22 17:59:29 +04:00
Alexander Udalov 0ec1f20140 Write generic signature for closure FunctionN superclass
ClosureCodegen.appendType() now appends any Type as a type parameter correctly
2013-04-22 17:59:29 +04:00
Alexander Udalov 974df0ed8e Use FunctionImplN instead of FunctionN in codegen
Superclass of closures should now be FunctionImplN instead of FunctionN. Since
these -Impl classes are needed only in JVM, the corresponding descriptors and
types are created in the back-end only.
2013-04-22 17:59:29 +04:00
Alexander Udalov 6f6cb03549 Make FunctionN interfaces
FunctionN and ExtensionFunctionN are now interfaces, with the corresponding
implementations in FunctionImplN and ExtensionFunctionImplN

Update test data
2013-04-22 17:59:29 +04:00
Alexander Udalov 34470ec89a Regenerate FunctionN and ExtensionFunctionN classes
GenerateFunctions now also generates Java classes in runtime/src/jet/
directory, and they have the matching declarations to those in
compiler/src/jet/

Delete ExtensionFunctionN's protected constructor, as it wasn't needed

Delete toString(), a more useful version will be implemented soon
2013-04-22 17:59:29 +04:00
Alexander Udalov 5c777a2f3a Refactor GenerateFunctions
Introduce FunctionKind enum to store differences between functions and
extension functions (and possible future function-like classes)

Also remove some useless checks
2013-04-22 17:59:29 +04:00
Alexander Udalov 5150eb1eea Fix newlines in FunctionN generator
Use println() instead of print('\n')
2013-04-22 17:59:29 +04:00
Nikolay Krasko ea52c6f717 KT-3508 Use a relative path for Kotlin bundled libraries instead of absolute path
#KT-3508 Fixed
2013-04-22 13:28:02 +04:00
Wojciech Lopata cd0e1b7508 RmoveUnnecessaryParenthesesIntention 2013-04-19 08:41:31 +02:00
Wojciech Lopata 3e76fc2902 Rename method 2013-04-19 08:21:00 +02:00
Nikolay Krasko 5df85f6100 KT-3525 Duplicate inner class name not detected
#KT-3525 Fixed
2013-04-19 01:10:54 +04:00
Nikolay Krasko 37f25f2ee1 KT-2258 Plugin does not suggest to import objects
#KT-2258 Fixed
2013-04-19 01:10:53 +04:00
Nikolay Krasko e1b1252657 Refactoring: rename auto import fix 2013-04-19 01:10:52 +04:00
Nikolay Krasko 2b8cac44bb Test for KT-1322 There's no autoimport suggested for traits
#KT-1322 Fixed
2013-04-19 01:10:52 +04:00
Mohammad Shamsi 296bda2e3a Fixed #KT-3379 jet.String.trimLeading and trimTrailing default whitespace trim 2013-04-19 01:10:51 +04:00
Evgeny Gerashchenko 622c1c3790 Reverted optimizing imports. 2013-04-18 22:33:06 +04:00
Evgeny Gerashchenko 7133f20247 Added tests with type parameter of class in SAM adapter. 2013-04-18 22:02:04 +04:00
Evgeny Gerashchenko 8c4e45de9a Supported SAM adapters with type parameters. 2013-04-18 22:01:26 +04:00
Evgeny Gerashchenko db8d285b25 Extracted method recreating type parameters. 2013-04-18 22:01:26 +04:00
Evgeny Gerashchenko f4994969c0 Added tests with type parameter of class in SAM adapter. 2013-04-18 22:01:26 +04:00
Evgeny Gerashchenko e554228a73 Added tests with mixture of SAM and non-SAM parameters. 2013-04-18 22:01:26 +04:00
Evgeny Gerashchenko 7bd11718de Supported simplest cases of SAM adapter in backend. 2013-04-18 22:01:26 +04:00
Evgeny Gerashchenko c5b9c6a7dc Minor. Removed index counter. Renamed variable. 2013-04-18 21:59:49 +04:00
Evgeny Gerashchenko 8f8d284fe1 Added Kotlin external annotations to codegen tests with Java. 2013-04-18 21:59:49 +04:00
Evgeny Gerashchenko be0238a61e Loading SAM adapters with wildcard types. 2013-04-18 21:59:49 +04:00
Evgeny Gerashchenko c8e02f75b0 Supported simplest cases of SAM adapter. 2013-04-18 21:59:49 +04:00
Evgeny Gerashchenko 37eccdb01f Saving "SAM interface" mark when resolving Java class. 2013-04-18 21:59:49 +04:00
Evgeny Gerashchenko 0ae0941e43 Minor. Used util method. 2013-04-18 21:59:48 +04:00
Mikhael Bogdanov 82d7f07cb3 Fixed bug in fix for KT 3492: Bug in bytecode generation for labeled super call from inner class & Property generation refactoring 2013-04-18 18:33:25 +04:00
Andrey Breslav fe4dd2f661 Fix tests (by extracting a method and calling it multiple times) 2013-04-18 17:36:30 +04:00
Andrey Breslav 140382e280 PSI getter fixed: left-hand side of a binary expression can now be null
EA-35976 - IAE: FqNameUnsafe.validateFqName
2013-04-18 16:34:10 +04:00
Mikhael Bogdanov c69e7f059d Duplicated JetTypeMapper.mapSignature removed 2013-04-18 15:03:43 +04:00
Mikhael Bogdanov a1d295638a ExpressionCOdegen.visitSimpleNameExpression simplification 2013-04-18 14:05:15 +04:00
Mikhael Bogdanov 1fd76845ad Regression test for kt3315 2013-04-17 18:55:04 +04:00
Leonid Shalupov a024facf95 Merge pull request #248 from nskvortsov/master
Fix test
2013-04-17 07:49:58 -07:00
Nikita Skvortsov d44fd866c0 Fix gradle integration test - avoid Maven local repository reference 2013-04-17 18:46:54 +04:00
Zalim Bashorov a4c02da10d Merge pull request #244 from lopekpl/type_mismatch3
QuickFix for EXPECTED_PARAMETER/RETURN_TYPE_MISMATCH
2013-04-17 07:35:08 -07:00
Wojciech Lopata d396c08454 QuickFix for EXPECTED_PARAMETER/RETURN_TYPE_MISMATCH (ChangeTypeFix) 2013-04-17 15:28:57 +02:00
Andrey Breslav edbbc6ec7b Unused method removed 2013-04-17 17:11:21 +04:00
Andrey Breslav 12cd0675bc A module can look up a namespace (package view) by FqName 2013-04-17 17:11:20 +04:00