Commit Graph

110 Commits

Author SHA1 Message Date
Dmitriy Novozhilov
9825984bc5 [NI] Update test data for diagnostic tests 2019-03-25 12:17:27 +03:00
Dmitriy Novozhilov
b07aed7a00 [NI] Fix determination of completion mode. #KT-30406 Fixed 2019-03-15 10:39:50 +03:00
Mikhail Zarechenskiy
9b3e17f0d7 [NI] Avoid building controversial systems by clipping extra constraints
#KT-23854 Fixed
2019-03-04 11:29:38 +03:00
Dmitriy Novozhilov
a236ad5686 NI: resolve try catch as synthetic function call (#KT-25435 fixed) 2019-02-17 12:46:11 +03:00
victor.petukhov
30762a450a Wrap diagnostic parameters to double quotes and split by comma instead of semicolon 2019-02-14 12:31:42 +03:00
victor.petukhov
46bd5ba107 Add alphabetical sorting diagnostics with same ranges 2019-02-14 12:31:42 +03:00
Mikhail Glukhikh
f3555daa60 Report UNUSED_PARAMETER on main parameter in 1.3+ #KT-26999 Fixed 2018-10-25 19:10:39 +03:00
Dmitry Petrov
df6d4f358a KT-22274 report warning on labels that can't be referenced
Labels are meaningful only if they can be referenced by 'break',
'continue', or 'return' expressions.
2018-07-25 12:08:20 +03:00
Dmitry Petrov
6fb913a463 KT-22274 report error/warning on incorrect return target label 2018-07-25 12:08:20 +03:00
Mikhail Zarechenskiy
612baacc25 Make useless elvis diagnostic more consistent for new and old inference
Also, remove diagnostics that can be covered by usual USELESS_ELVIS diagnostic
2018-04-12 14:38:55 +03:00
Mikhail Zarechenskiy
3afd4a2f4a [NI] Record all diagnostics from subcalls resolution results 2018-02-14 14:58:04 +03:00
Dmitry Savvinov
33f9576dd1 [NI] Turn off KnownTypeParameterSubstitutor for NI
The main consequence of it is that TYPE_MISMATCH range for control
structures became wider.

Also, for extra safety, don't change behaviour of OI.
2017-12-07 14:05:42 +03:00
Dmitry Savvinov
816d89e393 [NI] Improved testdata after changes in applicabilities
This commits introduces testdata changes, where NI behaviour strictly
improved, after several previous fixes.

For some tests, just WITH_NEW_INFERENCE directive was added. It
indicates, that some of previous commits first introduced error in that
test, and then some other commit fixed it (netting no overall testdata
change). It is preferrably to keep those annotations until we will
migrate to NI completely, to prevent unexpected regressions.
2017-12-07 12:49:56 +03:00
Mikhail Zarechenskiy
8757298994 Add diagnostics to test data from NI 2017-11-29 02:54:26 +03:00
Mikhail Zarechenskiy
a71238bf94 Place !WITH_NEW_INFERENCE directive to diagnostics test data 2017-11-29 02:53:49 +03:00
Stanislav Erokhin
4c456983eb Fix javac tests (add separate descriptor rendering) 2017-10-05 15:11:45 +03:00
Dmitry Petrov
3405ae30a1 Inner classes of generic classes can't extend Throwable
Do it in the same way as Java: prohibit inner classes (including
anonymous inner classes) capturing type parameters from outer classes
(but not outer methods) extending Throwable.

See KT-17981:
- Deprecated in 1.2
- Error in 1.3
2017-10-04 12:43:50 +03:00
baratynskiy
01883a41cb javac-wrapper: refactoring, fixes and tests 2017-08-29 18:01:36 +03:00
Mikhail Zarechenskiy
2d3ce89afc Use only completed arguments of special call 2017-07-13 12:26:03 +03:00
Denis Zharkov
bc564af2fc Regenerate mockJDK using openJDK 7 2017-06-24 17:26:01 +03:00
Mikhail Zarechenskiy
9847278699 Report error about invalid if as expression on the if keyword
#KT-14633 Fixed
2017-06-22 14:18:11 +03:00
Dmitry Neverov
cd24adac32 Detect redundant 'is' check
#KT-14187 Fixed
2017-05-15 11:24:35 +03:00
Mikhail Zarechenskiy
6a352bccb6 Resolve control label locally when label name clashes with fun name
#KT-5354 Fixed
 #KT-15085 Fixed
2017-04-17 16:21:02 +03:00
Dmitry Petrov
e0ebaac70c Perform additional checks on catch parameter declaration
KT-8320 It should not be possible to catch a type parameter type
KT-7645 Prohibit default value for `catch`-block parameter
2017-04-13 16:23:17 +03:00
Mikhail Zarechenskiy
c9b468581a Fix type checking of local return inside return expression
#KT-16426 Fixed
2017-04-10 12:48:09 +03:00
Denis Zharkov
4c69416f2b Report warning on unused entities that can be renamed to _
Currently it's all about lambda parameters/destructuring entries

 #KT-14347 In Progress
2016-10-24 10:19:25 +03:00
Mikhail Glukhikh
bfaa9cf56f UnreachableCode.getUnreachableTextRanges always returns at least one range #KT-14158 Fixed 2016-10-21 10:31:50 +03:00
Mikhail Glukhikh
8d48b0d2a0 UNUSED_VARIABLE is now reported only for last entry of destructuring declaration (if applicable) #KT-14221 Fixed 2016-10-10 14:42:09 +03:00
Mikhail Glukhikh
e7d290f726 Refactor PSI for destructuring declarations in for: they are now children of KtParameter and not instead of it 2016-10-06 21:03:19 +03:00
Ilya Gorbunov
d943079557 Exception typealiases rendering in test output 2016-08-17 12:40:50 +03:00
Nikolay Krasko
300e0acd27 Report RETURN_NOT_ALLOWED and RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY only on the return with label (KT-13340)
#KT-13340 Fixed
2016-08-05 13:16:05 +03:00
Stanislav Erokhin
585dcbf1f3 KT-10717 Type inference for lambda with local return
#KT-10717 Fixed
2016-06-10 21:28:05 +03:00
Mikhail Glukhikh
6b945ba103 Regular checkType() is now called during condition analysis, TYPE_MISMATCH_IN_CONDITION removed #KT-11998 Fixed 2016-04-27 18:12:28 +03:00
Denis Zharkov
b94baede38 Minor. Fix rendered Throwable member scope 2016-04-25 17:41:08 +03:00
Stanislav Erokhin
434bd0707d Correcting rewrite type info after compete call.
#KT-10934 Fixed
#KT-10896 Fixed
2016-02-08 20:49:31 +03:00
Ilya Gorbunov
5361f6e941 Make Throwable properties message and cause open.
#KT-5587 Fixed
2016-02-08 18:10:46 +03:00
Dmitry Petrov
e4583fd275 Do not report IMPLICIT_CAST_TO_ANY on last statement of lambda with Unit(?) in at least one branch. 2016-02-05 10:44:50 +03:00
Denis Zharkov
816c66063b Report special diagnostic when fake-call receiver is nullable
#KT-3602 Fixed
2016-02-02 08:17:49 +03:00
Dmitry Petrov
9db3440e72 Fix type inference issues for 'if' and 'when'.
Use 'expectedType' (when present) as an explicit type argument for a special construct call.
Unfortunately, this approach can't be used for elvis due to other elvis-related inference hacks.
Fixes KT-10807, KT-10811.
This also affects KT-6189: now we can infer proper type for 'if'.

If type inference for special call failed, and we found no type errors in sub-expressions,
report TYPE_INFERENCE_FAILED_ON_SPECIAL_CONSTRUCT error.
This (and the hack above) fixes KT-10809: code no longer compiles.
2016-01-27 17:07:20 +03:00
Mikhail Glukhikh
850dc89b38 For-loop now cannot use extension iterator on a nullable #KT-7428 Fixed 2016-01-26 19:03:23 +03:00
Stanislav Erokhin
298a075381 Minor. removed functions which declared in Standard.kt from diagnostic testdata.
Removed declaration for functions: TODO, run, with, apply, let.
2016-01-25 19:13:31 +03:00
Dmitry Petrov
f371e67ce8 PatternMatchingTypingVisitor:
rewrite type inference for 'when' using special constructs.
This fixes several type inference issues for 'when':
KT-9929, KT-9972, KT-10439, KT-10463
along with some other diagnostics-related issues.
2016-01-22 10:41:55 +03:00
Dmitry Petrov
0c52960d7a KT-10706: do not report IMPLICIT_CAST_TO_ANY on expressions of type Nothing 2016-01-19 10:50:09 +03:00
Dmitry Petrov
609ffc10a9 KT-10322, KT-10646, KT-10647:
- update diagnostic to (supposedly) more useful
- also report IMPLICIT_CAST_TO_ANY if expected type is DONT_CARE
 (effectively "no expected type" for lambda expression).
2016-01-14 10:08:20 +03:00
Dmitry Petrov
f54de08073 KT-10646, KT-10647:
Move IMPLICIT_CAST_TO_UNIT_OR_ANY to ControlFlowInformationProvider
(where checks for 'if' and 'when' used as expressions are performed).
2016-01-14 10:08:20 +03:00
Alexander Udalov
75f046fa81 Drop Throwable#printStackTrace, make it a JVM-specific extension 2015-12-25 20:16:18 +03:00
Dmitry Jemerov
e97e82d119 use terms "lambda expression" and "anonymous function" instead of "function literal" and "function expression" 2015-12-09 13:55:40 +01:00
Dmitry Petrov
76931affc6 KT-10139:
Non-exhaustive 'when' without 'else' used in expression is an error
regardless of expected type: it can't be an expression, even of type Unit.
2015-12-01 10:36:40 +03:00
Dmitry Petrov
1a3a296827 KT-10139: any if without else used in expression is an error
regardless of expected type: it can't be an expression, even of type Unit.

 #KT-10139 Fixed
2015-12-01 10:36:40 +03:00
Mikhail Glukhikh
de37cb8f40 Generic types may not extend kotlin.Throwable #KT-9816 Fixed 2015-11-30 15:24:32 +03:00