Commit Graph

69 Commits

Author SHA1 Message Date
Evgeny Gerashchenko 6c6abab033 Supported propagation for Java subclass of Kotlin class. 2012-12-07 14:41:58 +04:00
Alexander Udalov e2809b8080 Revert changes introduced in a31b7480
JavaElementFinder is no longer needed to find namespace$src$ classes
2012-10-25 21:42:09 +04:00
Alexander Udalov a8798de8d0 NamespaceCodegen.getNamespacePartInternalName()
Should be used instead of getMultiFileNamespaceInternalName()
2012-10-25 21:28:42 +04:00
Andrey Breslav 7719df1002 Properly detect Kotlin built-ins:
Built-in classes like jet.Int and jet.Iterable are loaded from source
files by KotlinBuiltIns class. It makes no sense to create JetLightClass
instances for such classes, moreover, it causes runtime failures.
Now we check the location a file was loaded from before creating a light
class, and skip if it is a built-in.

We also assert this in teh actual generation of light class bodies, and
print out OS information if something fails, because our detection strategy
may depend on OS-specific behavior.
2012-10-18 19:57:18 +04:00
Andrey Breslav 937c4e8baf BuiltinsScopeExtensionMode not needed any more
(see the changes in DefaultModuleConfiguration.java)
2012-10-17 13:48:07 +04:00
Andrey Breslav c719ae427a JetStandardClasses -> KotlinBuiltIns 2012-10-17 13:48:05 +04:00
Alexander Udalov a31b748092 JavaElementFinder now correctly finds namespace$src$ classes
No new tests added

 #KT-2839 Fixed
2012-10-10 18:11:11 +04:00
Nikolay Krasko 15a66dccef Move anonymous class to separate file 2012-09-27 18:52:59 +04:00
Nikolay Krasko 86d8be76cb EA-39162 Exception while trying to wrap method with default parameters 2012-09-27 18:52:58 +04:00
Nikolay Krasko 24dc31bd9a More information about errors in wrapping functions 2012-09-27 18:52:57 +04:00
Alex Tkachman bc1a4a1fe9 massive refactoring of CodegenUtil
- generation method names standartized on genXXX
- many methods moved to newly created AsmUtil
- some methods moved to CodegenContext
- got rid of almost trivial StubCodegen
2012-09-20 20:19:26 +03:00
Alex Tkachman cf92603f2a micro refactoring
- PsiCodegenPredictor moved to binding package
- CodegenUtil.findSuperCall method moved to CodegenBinding
= PsiCodegenPredictor unneeded bindingTrace parameter replaced by bindingContext
2012-09-13 08:33:07 +03:00
Nikolay Krasko b6e2381861 EA-36473 Wrap method for JetLightClass with invalid fq name 2012-09-11 21:29:42 +04:00
Alexander Udalov bb92655ecd Prohibit creation of JetLightClass on built-ins
If we allow JetLightClass to be created on built-in types, a normal codegen
would be launched, with a mapping from Kotlin to Java types enabled, every time
IDE requests built-in classes. Codegen would then try to make something
meaningless, e.g. create a class for a primitive type (since our jet.Boolean is
mapped to primitive boolean). This would result in different exceptions when
navigating to built-in library from IDE.

Add a helpful error message to ClassFileFactory if we ever again produce
classes for primitive types.
2012-09-11 17:08:33 +04:00
Alex Tkachman b45f19c0e2 GenerationState refactored to be (almost) immutable and methodless (modulo little protection from reuse)
GenerationStrategy introduced to handle separately cases of regular compilation and building of JetLightClasses (this was only real overridable behavior of GenerationState in old code)
state subpackage introduced
2012-08-30 09:33:10 +03:00
Alex Tkachman 8840a9bdd8 some static methods moved from JetTypeMapper to CodegenUtil & CodegenBinding 2012-08-29 14:30:44 +03:00
Nikolay Krasko 22794cbf64 Fix for EA-38626 - can't find class delegate for JetLightClass constructed for kotlin enum entry. 2012-08-28 19:32:46 +04:00
Andrey Breslav 08bb390820 Project is available in codegen 2012-08-24 12:18:18 +04:00
Nikolay Krasko 57d4a28a94 Remove duplicates and speeding-up PluginJetFilesProvider.allInScope 2012-08-23 15:53:41 +04:00
Nikolay Krasko 84a6c63d07 Remove some unused methods from QualifiedNamesUtil 2012-08-14 19:31:21 +04:00
Nikolay Krasko b5357d8738 Compile against 122.29 idea eap 2012-08-14 13:19:08 +04:00
Evgeny Gerashchenko 67304c64ff Removed unused myProject field from IntrinsicMethods. Removed from injector parameters, etc. 2012-08-09 15:13:42 +04:00
Nikolay Krasko 8d6b16eb23 Equals for JetLightClass 2012-08-08 15:23:40 +04:00
Andrey Breslav 5f3643804c Import directives migrated from ASM 3.3 to 4.0 with renamed packages 2012-07-25 12:07:19 +04:00
Evgeny Gerashchenko 6e7d08b478 Introduced BuiltinsScopeExtensionMode enum. Using it instead of CompilerSpecialMode to create JavaBridgeConfiguration. 2012-07-07 23:07:18 +04:00
Evgeny Gerashchenko 5a88d28154 Got rid of dependency on compiler dependencies in injector for TDA for JVM. 2012-07-07 20:33:22 +04:00
Nikolay Krasko f8371c1aa5 Check all files have same package 2012-06-20 16:23:37 +04:00
Nikolay Krasko 7b4fda4345 Don't create namespace class for file if codegen won't do so 2012-06-18 16:08:05 +04:00
Alex Tkachman 7d938dd98f one more step to multi-file compilation 2012-06-06 12:17:25 +03:00
Nikolay Krasko 601007c20f Stop using isJsProject method 2012-06-05 20:41:43 +04:00
Dmitry Jemerov ff7be5b7c3 don't increment out-of-code-block modification count for changes that are not in Kotlin files 2012-05-25 15:42:45 +02:00
Dmitry Jemerov fb5fd47591 remove try/finally which leads to masking of exceptions occurring during generation of stub class [r=max] 2012-05-24 17:34:47 +02:00
Stepan Koltsov 33a59ff5fe Name class
In the most places in frontend identifier is stored in Name class, was in String.
Name has two advantages over String:
* validation: you cannot accidentally create identifier with dot, for example
* readability: if you see String, you don't now whether it is
  identifier, fq name, jvm class name or something else

Name's disadvantage is (small) performance overhead. We have no value types in JVM.
2012-05-23 02:52:32 +04:00
Stepan Koltsov ecc4c484a6 move NameUtils, FqName into name subpackage 2012-05-23 02:52:30 +04:00
Dmitry Jemerov 88c4778055 rename Kotlin methods used in Java code 2012-05-22 19:09:39 +02:00
Dmitry Jemerov 09cf7ac2aa find usages and rename work for Kotlin classes called from Java code (KT-1641)
#KT-1641 fixed
2012-05-22 19:09:38 +02:00
Evgeny Gerashchenko 93b8a5ed5e Fixed KT-2019 Unit test runner: navigation by double click from a test to source code does not work
#KT-2019 fixed
2012-05-18 20:55:56 +04:00
Stepan Koltsov 216cbf7d9a assert error/NonExistentClass is only generated when mode = SIGNATURES
move classBuilderMode to injector and GenerationState from ClassBuilder
2012-04-19 18:56:05 +04:00
Stepan Koltsov b47d37094e properly report exception if analyze failed
#KT-1831 Fixed
2012-04-19 16:41:34 +04:00
Stepan Koltsov bc00216df9 replace JavaPsiFacade with own 2012-04-12 20:45:00 +04:00
Nikolay Krasko 26b47c0180 KT-1755 Duplicates in completion
#KT-1755 fixed
2012-04-11 17:54:45 +04:00
Pavel V. Talanov a030576052 Merge from brahch analyzeJS.
Conflicts:
	compiler/backend/src/org/jetbrains/jet/codegen/GenerationState.java
	compiler/cli/src/org/jetbrains/jet/compiler/CompileSession.java
	compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/AnalyzerFacadeForJVM.java
	compiler/tests/org/jetbrains/jet/codegen/GenerationUtils.java
	compiler/tests/org/jetbrains/jet/resolve/ExpectedResolveData.java
	compiler/tests/org/jetbrains/jet/types/JetDefaultModalityModifiersTest.java
	idea/src/org/jetbrains/jet/plugin/libraries/JetSourceNavigationHelper.java
	idea/src/org/jetbrains/jet/plugin/parameterInfo/JetFunctionParameterInfoHandler.java
	idea/src/org/jetbrains/jet/plugin/project/WholeProjectAnalyzerFacade.java
	idea/src/org/jetbrains/jet/plugin/quickfix/ChangeVariableMutabilityFix.java
	idea/src/org/jetbrains/jet/plugin/quickfix/ImportInsertHelper.java
	idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixUtil.java
	idea/src/org/jetbrains/jet/plugin/refactoring/JetNameSuggester.java
	idea/src/org/jetbrains/jet/plugin/refactoring/JetRefactoringUtil.java
	idea/src/org/jetbrains/jet/plugin/refactoring/introduceVariable/JetIntroduceVariableHandler.java
2012-04-09 17:06:56 +04:00
Stepan Koltsov 10dd366216 CompilerDependencies
Holds reference to runtime.jar and jdk-headers.jar. Paths to these
jars are no longer hardcoded.

Many tests now compile runtime before execution. Because of this:
* Single test invocation is significantly slower now for some tests
* This can be fixed by making tests independent from runtime (this
must be done anyway)

Some tests still depend on runtime.jar built by "ant dist", this
is to be fixed.
2012-04-09 03:04:50 +04:00
Pavel V. Talanov 766b4dc975 Move AnalyzerExhaust from frontend.java to frontend. 2012-04-04 16:11:40 +04:00
Maxim Shafirov 060be0a8f8 Refactor dependencies, so jet-as-java might be used in cli. 2012-03-29 21:18:35 +04:00
Stepan Koltsov e6fda5b3d3 minor codegen refactoring
* cleanup after yesterday
* remove BindingContext stack in GenerationState
* use more power and strength of di

TODO: also initialize GenerationState by DI
2012-03-29 19:47:50 +04:00
Stepan Koltsov 1e330fe0a0 jvm.backend: get JetStandardLibrary from analyzer
This is a big step towards removal of JetStandardLibrary.getInstance()
2012-03-29 01:03:44 +04:00
Nikolay Krasko 0cd839f044 EA-34998 Check qualified name from external before creating instance of FqName 2012-03-22 17:46:18 +04:00
Stepan Koltsov 9557507beb replace "0" suffix in variable names 2012-03-19 17:37:44 +04:00
Andrey Breslav 5af3770563 Assetion for EA-34591 - NPE: AbstractLightClass.isValid 2012-03-16 18:42:53 +04:00