Commit Graph

932 Commits

Author SHA1 Message Date
Tal Man aeb5bae556 Refactoring of CompileTimeConstant, introduce flag to represent a constant being referenced by a variable 2014-04-09 14:47:05 -04:00
Alexander Udalov cbe6e49a93 Consider outer classes when topsorting hierarchy
- when building a topsorted hierarchy, consider not only edges to the class'
  superclasses, but also from inner/nested classes to their container. This
  effectively means that a class cannot inherit from its nested class. Similar
  cases (see the tests) are disallowed in Java.
- filter classes by their presence in TopDownAnalysisContext, not by being a
  MutableClassDescriptor (otherwise analysis for local classes ends up trying
  to do something with outer superclasses)
- delete outdated comment: topsort is needed not only for better diagnostics,
  but also for correct order of fake overrides construction
2014-04-03 19:12:56 +04:00
Alexander Udalov 9b2291d381 Fix StackOverflowError on cyclic hierarchy Java<->Kotlin
Report errors not only when superclasses are MutableClassDescriptorLite, but
any classes

 #KT-2115 Fixed
2014-04-03 19:04:12 +04:00
Andrey Breslav 4b5a192e4c Don't add primary constructors parameters for properties 2014-03-26 21:10:27 +04:00
Andrey Breslav bf2cc99109 Don't add delegated members from error types 2014-03-26 21:10:27 +04:00
Andrey Breslav 34c6eaec56 Correct scope for property accessors in lazy resolve 2014-03-26 21:10:27 +04:00
Andrey Breslav 4dfb6763b2 Alias importing fixed for the lazy case 2014-03-26 21:10:27 +04:00
Ilya Ryzhenkov 98c54f39bb Unify script file extensions to "kts" so that IDEA, compiler and tests agree when to parse as SCRIPT.
Include kt* files into formatter test generation, to test scripting formatting
2014-03-24 18:17:50 +04:00
Alexander Udalov 7d311cdfa0 Support named arguments for Java constructors annotated with KotlinSignature 2014-03-20 12:49:16 +04:00
Svetlana Isakova 75fbecceda Improved error reporting for invoke on expression 2014-03-20 10:06:02 +04:00
Svetlana Isakova a829da185d Resolve invoke on any kind of expressions, not only on simple name expressions 2014-03-20 10:05:24 +04:00
Alexander Udalov 1c5df773c5 Disallow named arguments for Java methods
Since they don't have stable names: they're (sometimes) loaded from the
bytecode, which (sometimes) doesn't contain parameter names
2014-03-19 23:24:28 +04:00
Alexander Udalov 5fa1774cc1 Support hasStableParameterNames in KotlinSignature and propagation
#KT-1924 In Progress
 #KT-2830 Fixed
2014-03-19 23:24:28 +04:00
Alexander Udalov 7fcd42f40c Fix annoying parameter name override warning
Some corner cases still remain: KotlinSignature, propagation, deserialized
delegates to Java interfaces

 #KT-1239 Obsolete
 #KT-1924 In Progress
 #KT-2081 Fixed
2014-03-19 23:24:27 +04:00
Andrey Breslav f7c5dc179c Eager resolve does not record class object bounds (which are unsupported anyways) 2014-03-17 21:55:17 +04:00
Andrey Breslav b72bcfd8ae Type bounds check for class headers moved to DeclarationsChecker 2014-03-17 21:55:15 +04:00
Andrey Breslav 8be40c29cf CYCLIC_INHERITANCE_HIERARCHY reworked
We do not try to recover too gracefully from a cyclic hierarchy any more:
we simply remove all the edges that belong to a cycle instead of intelligently finding one most convenient edge to cut.
This is done in both lazy and eager resolve to keep tests passing.
2014-03-17 21:55:15 +04:00
Alexander Udalov 7a2fce4fba Add regression tests for obsolete issues
#KT-2592 Obsolete
 #KT-2768 Obsolete
2014-03-16 03:18:26 +04:00
Svetlana Isakova 604e062f91 Fixed assertion error for incomplete code. 2014-03-13 19:09:01 +04:00
Svetlana Isakova fbbfb95861 added 'mergeDataWithLocalDeclarations' option
for collecting variable data for pseudocode

  removed using data from outer context
  for local declarations for 'variable initializers' analysis
2014-03-07 21:08:18 +04:00
Svetlana Isakova 7d46ff951e Jump after 'for' cycle to loop parameter change.
Not to the cycle body.
2014-03-07 21:08:17 +04:00
Alexander Udalov f7b6457139 Replace "jet" package name with "kotlin" in testData 2014-03-02 19:55:26 +04:00
Alexander Udalov 3dcd85bdb4 Add toString() to Any, fix all tests
#KT-4517 Fixed
2014-03-02 19:54:49 +04:00
Alexander Udalov ec30d52978 Delete Hashable, pull up its members to Any
Extensions on nullable types remain in Library.kt

 #KT-1741 Obsolete
 #KT-2805 Obsolete
 #KT-1365 Fixed
 #KT-4517 In Progress
2014-03-02 19:54:08 +04:00
Andrey Breslav fbdba0f48d Test data fixed 2014-02-26 20:48:45 +04:00
Andrey Breslav a7135fee06 Report CLASS_OBJECT_NOT_ALLOWED for local classes 2014-02-26 19:42:05 +04:00
Tuomas Tynkkynen 3e451c5811 Disallow break or continue across a function boundary
Code containing breaks or continues that attempt to jump across a
function boundary weren't detected during analysis but would crash
the compiler during code generation. Add diagnostics for these kinds
of errors.

Example:

fun f() {
    while (true) {
        fun inner() {
            continue
        }
    }
}

 #KT-4334 Fixed
2014-02-26 00:14:42 +02:00
Svetlana Isakova 70374ea9be KT-4529 Lambdas are analyzed improperly in an infix call nested inside a println
#KT-4529 Fixed
2014-02-12 14:47:10 +04:00
Svetlana Isakova 791fa22abb KT-4405 Control-flow analysis is not performed for some local declarations #KT-4405 Fixed 2014-02-12 12:48:13 +04:00
Svetlana Isakova aa713ef1f6 generate pseudocode for property accessor only if the property is local
otherwise check it independently like a function
2014-02-12 12:48:12 +04:00
Svetlana Isakova 1c4db84d92 do not try properties named 'invoke' when resolve 'invoke' 2014-02-12 12:48:12 +04:00
Svetlana Isakova 9ed57a5767 removed AutoCastReceiver
check subtype for receiver by AutoCastUtils.isSubTypeByAutoCast directly
 #KT-4403 Fixed
 #KT-4415 Fixed
2014-02-12 12:48:10 +04:00
Svetlana Isakova 5ef320173c generate pseudocode for functions in local classes
#KT-4405 In progress
 #KT-3501 Fixed
2014-02-11 21:07:10 +04:00
Svetlana Isakova 8868da8c5f KT-4372 Invalid error position and failing to resolve invoke with receiver from other module #KT-4372 Fixed 2014-02-11 21:07:09 +04:00
Svetlana Isakova 45abab2a2c KT-4341 No resolved call for right-hand side of equals expression
#KT-4341 Fixed
2014-02-11 21:07:08 +04:00
Svetlana Isakova aca21f78d5 check incomplete equality 2014-02-11 21:07:08 +04:00
Pavel V. Talanov 80183c88cf Do not normalize visibilities for fake overrides
#KT-4525 Fixed
2014-02-11 20:13:11 +04:00
Evgeny Gerashchenko ce7e0a7457 Fixed problem with overriding method with non-trivial raw type (when erased type parameter has upper bound)
Also added cases for the code which was changed.
2014-02-06 13:52:59 +04:00
Natalia Ukhorskaya 4dbcb256d3 Add JetDiagnosticTest with stdlib 2014-01-28 18:21:46 +04:00
Natalia Ukhorskaya 3f429116e5 Add constructor parameter for compileTimeConstant (can be used in annotation) 2014-01-28 18:21:44 +04:00
Natalia Ukhorskaya fd3f852a93 Annotation parameter must be constant on vararg and array arguments 2014-01-28 18:21:43 +04:00
Natalia Ukhorskaya 97da2def08 Record COMPILE_TIME_INITIALIZER for all final variables 2014-01-28 18:21:42 +04:00
Nikolay Krasko 559f212cfc Redeclaration for same file in different files 2014-01-17 17:28:13 +04:00
Evgeny Gerashchenko 82af76fa85 Fixed file name case. 2014-01-16 22:57:25 +04:00
Evgeny Gerashchenko ae4c68830d Importing root scope without members. 2014-01-16 22:11:55 +04:00
Evgeny Gerashchenko c924a5d097 Test for KT-3444 Front-end doesn't check if local function or function of anonymous class returns value
#KT-3444 obsolete
2014-01-14 19:13:19 +04:00
Evgeny Gerashchenko cb78defa36 Considering static members when checking package-private visibility. 2014-01-14 19:13:16 +04:00
Evgeny Gerashchenko e994b718cb KT-4351 Cannot resolve reference to self in init of class local to function
#KT-4351 fixed
2014-01-14 19:13:16 +04:00
Evgeny Gerashchenko 958f7c862d Got rid of "namespace" word in test data. 2014-01-14 18:06:50 +04:00
Evgeny Gerashchenko 093afeb05c Renamed diagnostics (namespace → package). 2014-01-14 18:06:49 +04:00