Commit Graph

20900 Commits

Author SHA1 Message Date
Michael Nedzelsky 4dc4e6a021 jsHeaderLibraryDetectonUtil.java: convert to kotlin 2015-03-12 16:35:30 +03:00
Michael Nedzelsky cea65e0770 add NotNull annotation into BasicTest 2015-03-12 16:35:25 +03:00
Michael Nedzelsky 54bbe0711d JS backend: reuse analysisResult from K2JSCompiler in translator 2015-03-12 16:35:22 +03:00
Michael Nedzelsky 95768db9a1 fix NPE while creating new Kotlin/Javascript project 2015-03-12 15:58:14 +03:00
Andrey Breslav 2f39cb6243 Remove useless casts after fixing subtyping for star projections 2015-03-12 15:46:40 +03:00
Alexander Udalov b8674beac0 Fix build-protobuf-java-lite macro in update_dependencies.xml
Apparently vmlauncher=false invokes antRun which is missing in the Ant support
plugin in IDEA, so invoking update from IDEA was failing
2015-03-12 14:33:07 +03:00
Nikolay Krasko dcd29cb65d Revert "Generate descriptor for trait constructor. Exception is thrown otherwise (EA-38416)"
This reverts commit 6ba120bba8.
2015-03-12 14:18:22 +03:00
Nikolay Krasko 6ba120bba8 Generate descriptor for trait constructor. Exception is thrown otherwise (EA-38416) 2015-03-12 12:59:22 +03:00
Nikolay Krasko 38809761e2 Other base method 2015-03-12 12:35:11 +03:00
Michael Bogdanov 30832ed774 Properly report diagnostics on platformStatic annotations
#KT-6937 Fixed
2015-03-12 10:29:00 +03:00
Alexey Sedunov 84ad6c394e Create from Usage: Respect smart-casts when suggesting parameter type candidates
#KT-6781 Fixed
2015-03-11 23:34:00 +03:00
Alexey Sedunov b033c17426 Caller Hierarchy: NPE fix
#EA-66031 Fixed
2015-03-11 23:33:59 +03:00
Alexey Sedunov 11a4cdf7ec Control-Flow Analysis: Fix NPE for array assignments without right-hand side
#EA-63602 Fixed
2015-03-11 23:33:58 +03:00
Alexey Sedunov 56031cb270 Control-Flow Analysis: Fix bug in finally-block repetition in the presence of non-local returns
#EA-65982 Fixed
2015-03-11 23:33:57 +03:00
Alexey Sedunov f0b0fd07c5 Create From Usage: Add support of star projections/incorrect type arguments
#EA-62661 Fixed
2015-03-11 23:33:56 +03:00
Alexey Sedunov ab5a691612 Create From Usage: Place generated declarations next to original element container if they have common parent
#KT-6687 Fixed
2015-03-11 23:33:55 +03:00
Alexey Sedunov fe9b08f93d Create From Usage: Place local variable declaration right before its usage
#KT-6704 Fixed
2015-03-11 23:33:54 +03:00
Alexey Sedunov 8a0808b133 Create From Usage: Do not generate type for local variables, but add dummy initializer instead
#KT-6705 Fixed
2015-03-11 23:33:52 +03:00
Pavel V. Talanov 2987e72d29 Do not report redeclaration when outer class and default object's members clash
Previously we prohibited classes and properties with the same name (now it's unnecessary)
Add test for backends that they support qualified (by default object name) member references inside class body
2015-03-11 21:06:05 +03:00
Andrey Breslav 76832df933 Do not create temp files in the project directory 2015-03-11 20:14:56 +03:00
Andrey Breslav 7b9d0cfc4f Minor. Compilation fixed 2015-03-11 19:38:17 +03:00
Andrey Breslav 44e7df2809 Minor. Formatting and simplification 2015-03-11 19:38:17 +03:00
Andrey Breslav 704eea2eac TraceBasedErrorReporter converted to Kotlin and [data] added to AbiVersionErrorData 2015-03-11 19:38:16 +03:00
Andrey Breslav 3146b7e1b0 Rename .java file to .kt 2015-03-11 19:38:16 +03:00
Andrey Breslav 0562ab84c2 Minor. Warnings fixed 2015-03-11 19:38:15 +03:00
Andrey Breslav 36bbd2c0e3 ErrorReporter is now Java-independent 2015-03-11 19:38:15 +03:00
Andrey Breslav 266485add3 Serialization of star projections fixed 2015-03-11 19:38:14 +03:00
Andrey Breslav 61989ba245 KT-6815 Representing raw types when used as supertypes for Java classes
#KT-6815 Fixed
2015-03-11 18:27:37 +03:00
Andrey Breslav 7c62d8ed83 Minor. Unused declarations removed 2015-03-11 18:27:37 +03:00
Andrey Breslav e0b7e4efca KT-6803 Subtyping breaks on star-projections for recursive generics
Star-projections have upper bounds of the form "parameter's bound where all parameter of the same class are substituted with their star-projections"

  #KT-6803 Fixed
2015-03-11 18:27:36 +03:00
Alexander Udalov 11b693c3be Add test on scripts with classpath 2015-03-11 18:08:14 +03:00
Isak Karlsson efae5c05a1 Support classpath argument when running scripts using the -script flag
Signed-off-by: Isak Karlsson <isak-kar@dsv.su.se>
2015-03-11 18:08:14 +03:00
Denis Zharkov f632a90741 Fix compiler settings for android-compiler-plugin
It's necessary to use bootstrap-compiler and runtime but new compiler in classpath when increasing ABI.

For example ABI was X, then we increase it to X':

- It compiles in Bootstrap (B) build with compiler that knows
  old ABI version, so compiled compiler (C1) will still have version X, but new
  runtime's version is X' (R1).

  So when we compile android-compiler-plugin each part has version X.

- Then project compiles by new compiler (C1)
  (that class-files have ABI version X, but it knows about X') in main build.
  Here compiled compiler (C2) will have X' version of class-files,
  either has runtime (R1) compiled on previous stage.

  On this step android-compiler-plugin will be compiled fine by C1 and with C2, R1.
2015-03-11 17:45:29 +03:00
Denis Zharkov 70c573864a Prohibit DelegationBy specifier when no primary constructor
Also add codegen test for case when there is primary
2015-03-11 17:45:29 +03:00
Denis Zharkov 582755e71a Don't generate empty constructor if there is secondary one with empty parameter list 2015-03-11 17:45:29 +03:00
Denis Zharkov aab706a6a6 Revert test checking ENUM_ENTRY_ILLEGAL_TYPE 2015-03-11 17:45:28 +03:00
Denis Zharkov 5eb4dcd913 Report conflicting overloads for constructors
- It's worked almost fine but diagnostics were filtered out by
  positioning strategy.

- Also a couple of "put" calls to Multimap are replaced by "putValues"
  within OverloadResolver, that is more semantically correct.

- Note that constructors of top-level classes are handled when processing
  package, it helps to figure out if there are clashes with top-level
  functions that have the same name.

- But constructors of different classes are not reported as
  overloads because containing classes has the same name and will be
  reported as redeclaration.
2015-03-11 17:45:28 +03:00
Denis Zharkov 9d2d3c0c7b Take data flow info from delegation call 2015-03-11 17:45:28 +03:00
Denis Zharkov aa5599f6ca Improve positioning strategy for delegation calls 2015-03-11 17:45:28 +03:00
Denis Zharkov 4022982760 Add synthetic argument to default constructors
It's need to add synthetic argument (of type that user can't use)
to constructors with default arguments to avoid clashing with
real user's constructor having the same set of parameters
and additional int's arguments.
2015-03-11 17:45:28 +03:00
Denis Zharkov 67f97fea42 Prohibit data classes with no primary constructor 2015-03-11 17:45:28 +03:00
Denis Zharkov 40d7816575 Regenerate protobuf classes
After secondary constructors serialization
2015-03-11 17:45:27 +03:00
Denis Zharkov 111a138a2a Serialize secondary constructors 2015-03-11 17:45:27 +03:00
Denis Zharkov e65382e6ec Support secondary constructors in JVM backend
There is a lot of changes about closures calculating and generating.

1. As classes can have more than one constructor each of them should
have closure arguments.

2. Captured variables set is the same for all of them.

3. Within constructors bodies/delegating calls closure parameters
should be accessed through method arguments because fields may be
not initialized yet.
2015-03-11 17:45:27 +03:00
Denis Zharkov 6779e95767 Simplify closure analysis within constructors
Using of ConstructorContext instance almost has no sense,
but it complicates logic when there are several constructors.
2015-03-11 17:45:27 +03:00
Denis Zharkov 31be68de0a Get rid of superCall fields in class/closure codegen
Because their semantics looks wrong in case of secondary constructors.
Use resolved delegation call instead.
2015-03-11 17:45:27 +03:00
Denis Zharkov 4c26d037d9 Resolve property initializer if there is no primary constructor 2015-03-11 17:45:27 +03:00
Denis Zharkov a872a51a19 Prohibit explicit super call for enum ctrs 2015-03-11 17:45:26 +03:00
Denis Zharkov 1703e16913 Add quickfix: remove 'init' modifier 2015-03-11 17:45:26 +03:00
Denis Zharkov f07566d30d Add warning for initializers with obsolete syntax
Expected 'init' keyword before class initializer
2015-03-11 17:45:26 +03:00