Commit Graph

2771 Commits

Author SHA1 Message Date
Alexander Udalov 2ea9a2cfc9 Generate annotations on enum entry constants in bytecode
#KT-5665 Fixed
2014-08-25 17:50:08 +04:00
Pavel V. Talanov db5303c019 Implement modules in IDE
IDE:
Rewrite AnalyzerFacade and implementations for JS and JVM to support creating separate analyzers for each module
Introduce ModuleInfo which is an intermediate entity between configuration (tests or idea modules) and ModuleDescriptor
Implement IdeaModuleInfos which represent IDEA modules, sdks and libraries
Add (somewhat thin) test checking their behaviour
Implement getModuleInfo() - utility to obtain IdeaModuleInfo for PsiElement
Drop Project.getLazyResolveSession() - not possible to obtain resolve session for the whole project any more
Adjust JavaResolveExtension accordingly
KotlinSignature Intention/Marker - make sure that analyzed element is cls element (he's not in resolve scope otherwise)

LightClasses:
Create separate package light classes for each module
Java code can only reference light class from the first module among it's dependencies
Duplicate jvm signature is only reported on package declarations inside one module

Injectors:
Receive GlobalSearchScope as paramer for VirtualFileFinder and JavaClassFinder
which allows to narrow analyzer scope

JDR:
Introduce ModuleClassResolver resolves java classes in correct java descriptor resolver (corresponding ModuleDescriptor)
Add test checking that java classes belong to correct module

Debugger:
Provide context to analyze files created by debugger in

Converter:
Postprocessor now needs a context to analyze resulting code in

JetPsiFactory:
Add verification that files created by psi factory are not analyzed without context (that is almost never a good idea)

Other:
Use new API in various tests, utilities, run configuration producers and builtin serializers
Various "TODO: (module refactoring)" which mark the unfinished parts
2014-08-22 22:58:54 +04:00
Andrey Breslav 1933e30905 Test data split between compiledJava tests and compiledKotlin tests
Basically, this commit splits test data from the from java-txt-kt to two pairs java-txt and kt-txt.
This commit leads to some duplication in test data.
This is temporary: in the platform types branch the test data for LoadJava tests will be changed dramatically, so duplication will go away
2014-08-21 12:22:22 +04:00
Denis Mekhanikov 1533c0e9f3 Support more than 32 default arguments
#KT-4675 Fixed
2014-08-20 20:47:34 +04:00
Evgeny Gerashchenko 184ddbc9e1 Removed passing incremental cache base dir via module script. 2014-08-20 13:46:29 +04:00
Alexander Udalov 99d4f97aef Fix access to top level delegated property from another property
#KT-5612 Fixed
2014-08-14 10:43:50 +04:00
Alexander Udalov 9e971ed2b9 Minor, add test on enum assignability to kotlin.Enum 2014-08-13 17:19:56 +04:00
Alexander Udalov 226bfe65f0 Don't make traits and annotations inherit from KObject
#KT-5609 Fixed
2014-08-13 17:19:56 +04:00
Alexander Udalov 47d5f83d04 Report unmet trait requirements
#KT-3006 Fixed
2014-08-13 17:19:55 +04:00
Alexander Udalov 9c00e1c94d Scripts: coerce result to the actual expression type
#KT-5622 Fixed
2014-08-13 17:19:53 +04:00
Alexander Udalov 844845c6e3 REPL: sanitize stack traces
Don't include our compiler's and preloader's internal code, reflection, native
methods etc. Also delete "substring" matching logic from tests
2014-08-13 15:42:10 +04:00
Alexander Udalov 6eb5567895 REPL: fix open parenthesis not triggering "incomplete"
Check if all of the syntax errors are at EOF, not that there's a single one.
In case of open parenthesis two syntax errors are reported for some reason
2014-08-13 15:13:25 +04:00
Alexander Udalov 4213ce318e REPL: don't fail on a callable reference
There should probably be a special kind of property, but at least it won't
throw an exception for now
2014-08-13 15:13:24 +04:00
Alexander Udalov 415fe7a5e6 Initial support for classes in scripts and REPL 2014-08-13 15:13:22 +04:00
Alexander Udalov c873806b54 Refactor "incomplete line" handling in REPL tests 2014-08-13 15:13:21 +04:00
Alexander Udalov c6dfa866cd Refactor REPL tests: use empty line instead of "null" 2014-08-13 15:13:19 +04:00
Alexander Udalov 9ae95c1e5c Generate codegen tests on scripts 2014-08-13 15:13:17 +04:00
Alexander Udalov a83d9a7dce CLI: introduce alias "-cp" for "-classpath" 2014-08-13 11:10:42 +04:00
Alexander Udalov b54d2ac0c5 CLI: don't fail on a wrong "-script" usage 2014-08-13 11:10:42 +04:00
Alexander Udalov 5a792ca11f CLI: output relative paths in diagnostic messages 2014-08-13 11:10:41 +04:00
Alexander Udalov 850fc25ee0 CLI: drop "-tags" argument
It was only used for the compiler inside the IDE, and there we already invoke a
special method which outputs HTML only
2014-08-13 11:10:41 +04:00
Alexander Udalov 97e57e3e3d CLI: change "-suppress warnings" option to "-nowarn"
Following the rule of the least surprise: this option is named "-nowarn" in
other JVM language compilers. Besides, having an option with an argument which
can take exactly one predefined value is sort of confusing
2014-08-13 11:10:40 +04:00
Alexander Udalov cf431ffab0 CLI: change argument naming convention
As in all other Unix/POSIX tools and JVM language compilers, multiple words
comprising the argument name should be lowercase, separated by dashes
2014-08-13 11:10:40 +04:00
Alexander Udalov 160cde09d6 CLI: Support "-X" advanced options, simplify some boolean options 2014-08-13 11:10:37 +04:00
Alexey Sedunov 311166737f Associate synthetic component function descriptors with corresponding
constructor parameters
2014-08-08 18:59:45 +04:00
Alexey Sedunov 9fee8600cb Pseudocode: Do not generate implicit return instruction inside of
Unit-typed lambdas
 #KT-5549 Fixed
2014-08-05 18:14:40 +04:00
Denis Zharkov e0ced7cbcf Boxing values merge fix. #KT-5588 Fixed
When merging Boxed value and something else just return MIXED_VALUE
2014-08-05 13:54:42 +04:00
Evgeny Gerashchenko f2b1879aae Added test for KT-1735 Can't access "assert" function from stdlib
#KT-1735 fixed
2014-08-04 13:38:36 +04:00
Svetlana Isakova 2ae87cae4a Function literal expression outside the parentheses wrapped into JetFunctionLiteralArgument
Extracted JetFunctionLiteralArgument.moveInsideParenthesesAndReplaceWith util function
2014-07-30 17:14:00 +04:00
Svetlana Isakova 4477a96ca7 Resolve operation (unary, array access) on error element instead of ignoring it
(to record corresponding call for later simplification in control flow)
Generate code for unmapped arguments in control flow
2014-07-30 17:14:00 +04:00
Svetlana Isakova fb4c256d08 Added tests for choosing 'most specific' resolution candidate
Fixed test (while resolve with library on android): 'run' resolves to library function
2014-07-30 17:07:10 +04:00
Svetlana Isakova eca2c7beea Added tests on resolved calls
for annotation entry, delegator to super call, array access
2014-07-30 17:07:10 +04:00
Svetlana Isakova 22624186f6 Added tests for 'super' resolved calls 2014-07-30 17:07:09 +04:00
Svetlana Isakova 11ea241efb Render candidate and resulting descriptors in resolved call tests 2014-07-30 17:07:09 +04:00
Nikolay Krasko 61b70d287e Update to 138.1283.4 EAP 2014-07-29 16:28:36 +04:00
Evgeny Gerashchenko 90b065e82b += tests fix 2014-07-29 12:06:36 +04:00
Denis Zharkov b86affaa3a Assignment operations test fix:
x is a byte, x += 2 translated to x = x+2, but type of (x+2) currently
is Int, so it's not compiled because Int can't be stored in Byte.

Maybe we need to think about what should be a result of sum of to
Bytes, but currently it's still Int
2014-07-28 22:00:15 +04:00
Denis Zharkov c4746bc90f Assignment operations test fix:
these methods used in expressions like a = a + b, so they need to return
NotNull when receiver is NotNull
2014-07-28 22:00:15 +04:00
Denis Zharkov 76845a76b9 Fixed KT-4814: check type when a += b is a = a+b
In cases when a += b is a = a + b, check that (a+b) can be safely casted to a
2014-07-28 22:00:14 +04:00
Alexey Sedunov 9cbcabffa4 Control-Flow Analysis: Reuse pseudo-value information for unused expression analysis 2014-07-28 13:07:37 +04:00
Alexey Sedunov 2a19016d58 Pseudocode: Add test for parenthesized call in selector 2014-07-28 13:07:34 +04:00
Alexey Sedunov 85bb4f9b8e Pseudocode: Generate read instructions on call expression (instead of
callee)
2014-07-28 13:07:33 +04:00
Alexey Sedunov 9f3ebe5f3b Pseudocode: Generate merge instruction regardless of number of branches 2014-07-28 13:07:32 +04:00
Alexey Sedunov d008cb8c21 Pseudocode: Do not regenerate receiver values 2014-07-28 13:07:30 +04:00
Alexey Sedunov 77bbf8f73b Pseudocode: Generate fake values for Unit/Nothing-typed expressions 2014-07-28 13:07:29 +04:00
Alexey Sedunov 2d3ac9109b Pseudocode: Generate synthetic VALUE_CONSUMER for both property and class delegates 2014-07-28 13:06:46 +04:00
Alexey Sedunov d07deeb5fb Pseudocode: Generate UNSUPPORTED_ELEMENT for misplaced returns 2014-07-28 13:04:02 +04:00
Alexey Sedunov b0bf11c51e Pseudocode: Consume value of true condition in while-loop 2014-07-28 13:04:01 +04:00
Alexey Sedunov e11ffb8542 Pseudocode: Replace UnsupportedElementInstruction with UNSUPPORTED_ELEMENT magic.
Generate UNSUPPORTED_ELEMENT for assignments with unresolved left-han side
2014-07-28 13:04:00 +04:00
Alexey Sedunov c32d112e67 Pseudocode: Generate magics for cast expressions 2014-07-28 13:03:12 +04:00