Commit Graph

1295 Commits

Author SHA1 Message Date
Alexey Tsvetkov 5ff5cea17a JS: report error when js() produces empty AST 2015-03-23 16:43:49 +03:00
Alexey Tsvetkov b5797eb15b JS: added tests for recursion cycle in inline functions 2015-03-23 16:43:48 +03:00
Zalim Bashorov d569ea5974 JS frontend: added diagnostic about secondary constructors not supported yet. 2015-03-23 13:52:56 +03:00
Zalim Bashorov 1b530887cd Minor: fix testdata 2015-03-20 21:23:31 +03:00
Zalim Bashorov aaa7f6d5e4 JS frontend: added diagnostic about non-toplevel classifiers are unsupported yet. 2015-03-20 21:23:31 +03:00
Denis Zharkov bd5dbb665e Fix header scope for secondary constructors
Add companion object's scope and nested classes

 #KT-6996 fixed
2015-03-18 19:59:24 +03:00
Stanislav Erokhin 43e24f6b0d Fixed test data for new lambda syntax 2015-03-18 16:06:44 +03:00
Stanislav Erokhin 371908a280 Temporary added DEPRECATED_LAMBDA_SYNTAX to tests.
It will be fixed soon.
2015-03-18 16:06:44 +03:00
Stanislav Erokhin 47e8b1e77c Create warning for old lambda syntax. 2015-03-18 16:06:44 +03:00
Stanislav Erokhin 446816e3db Created automatic labeling of function expression. 2015-03-18 16:06:44 +03:00
Denis Zharkov 36665fe3b8 Change logic of constructor delegation call resolution
- If class has type arguments (A<T1,..>) then
  resolve it's delegation call to `this` as for expression A<T1, ..>()
  like type arguments are explicitly specified.

- Same logic works for `super` delegation calls.

- It could be just enough to substitute all candidates before resolve
  but diagnostic messages looks more correct when substitution is
  performed within CandidateResolver.performResolutionForCandidateCall
  because it works the same way as when resolving A<T1, ..>().

 #KT-6992 Fixed
 #KT-6993 Fixed
 #KT-6994 Fixed
2015-03-17 23:18:35 +03:00
Denis Zharkov 9cecd69a9e Drop unneeded condition that leads to error
This check is obsolete but leads to problems.

It appears when resolving recursive calls (see sameTypeParameterUse.kt):

`foo<R>(x: R, y: R)` within call `foo<R>(x, "")` after substitution
has R as type of it's second argument, and when checking value arguments,
x is not checked because supposed to be dependent on type parameter of candidate
(that is effectively false), so there are two successful candidates
in resolution results and wrong OVERLOAD_RESOLUTION_AMBIGUITY error.
2015-03-17 23:18:34 +03:00
Denis Zharkov 9e5192e0e3 Prohibit val/vars/modifiers on secondary constructor parameter
#KT-6962 Fixed
2015-03-17 23:18:33 +03:00
Pavel V. Talanov 06916d98c6 default -> companion: replace all mentions of default and default object 2015-03-17 15:47:39 +03:00
Nikolay Krasko 8c5109d819 Generate descriptor for trait constructor. Exception is thrown otherwise...
EA-38416, EA-65189, EA-60850
2015-03-16 20:16:25 +03:00
Alexander Udalov e5d5b49ce2 Fix exception from ::class literals on unresolved classes 2015-03-12 23:14:55 +03:00
Stanislav Erokhin 8accdcc5cb Fix type inference for function expression parameters 2015-03-12 17:11:53 +03:00
Stanislav Erokhin f47f285868 Expected function type used for parameter types inference in function expression 2015-03-12 17:11:53 +03:00
Stanislav Erokhin 639003b8a8 Allowed function parameter without type declaration in the parser 2015-03-12 17:11:52 +03:00
Stanislav Erokhin d9882a6d0b Move inference parameter type in FunctionDescriptorResolver 2015-03-12 17:11:52 +03:00
Stanislav Erokhin 929f1bc9ba Fixed method hasTypeParameterListBeforeFunctionName in JetNamedFunction 2015-03-12 17:11:47 +03:00
Stanislav Erokhin 44895a23cf Frontend support for function as expression 2015-03-12 17:11:46 +03:00
Stanislav Erokhin 560c32c0f1 Added diagnostic error when in function declaration name was omitted 2015-03-12 17:11:44 +03:00
Stanislav Erokhin a33450395c Resolve parenthesized element as expression 2015-03-12 17:11:43 +03:00
Stanislav Erokhin 3b92cab9e0 Changed containing declaration for PropertyDeclarationInnerScope 2015-03-12 17:11:43 +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
Michael Bogdanov 30832ed774 Properly report diagnostics on platformStatic annotations
#KT-6937 Fixed
2015-03-12 10:29:00 +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 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 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
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 67f97fea42 Prohibit data classes with no primary constructor 2015-03-11 17:45:28 +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 f07566d30d Add warning for initializers with obsolete syntax
Expected 'init' keyword before class initializer
2015-03-11 17:45:26 +03:00
Denis Zharkov 0dc155d8c9 Resolve annotations on secondary constructors 2015-03-11 17:45:26 +03:00
Denis Zharkov 7d963e8e07 Differ this/non-this instances for vars initialization in class
When deal with constructed object (not this) treat it like it's fully initialized.

Otherwise (this or access with no receiver) access instruction
should be handled as it was before.

 #KT-6788 Fixed
 #KT-4126 Fixed
2015-03-11 17:45:25 +03:00
Denis Zharkov f673f4ff47 Prohibit super delegation call if there is primary constructor 2015-03-11 17:45:25 +03:00
Denis Zharkov 835a0df13a Prohibit secondary constructors in traits 2015-03-11 17:45:25 +03:00
Denis Zharkov 4a628a3d8f Prohibit supertype initialization without primary constructor 2015-03-11 17:45:25 +03:00
Denis Zharkov 28fbdb7c53 Prohibit constructors declarations for object 2015-03-11 17:45:24 +03:00
Denis Zharkov 3fef4ad742 Minor, drop unneeded accept 2015-03-11 17:45:24 +03:00
Denis Zharkov 525ddf9eb0 Prevent circular secondary constructors delegation 2015-03-11 17:45:24 +03:00
Denis Zharkov 7f20c4a237 Control flow changes for secondary constructors 2015-03-11 17:45:24 +03:00