Commit Graph

15 Commits

Author SHA1 Message Date
Dmitry Petrov
b3f390abe5 Fix KT-10775 Empty when causes compilation exception.
Expression type for an empty 'when' is 'kotlin.Unit'.
2016-01-29 18:50:48 +03:00
Mikhail Glukhikh
9360bd49a6 Data flow info: correct disjunction of a type with Nothing: Type U Nothing = Type #KT-9578 Fixed 2016-01-19 16:01:10 +03:00
Mikhail Glukhikh
7d6ccc40c2 Implicit exhaustive whens now have exception in else branch #KT-8700 Fixed 2015-12-26 10:46:39 +03: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
Yan Zhulanow
9d1af5a17e Fix tests: "infix modifier required" and "operator modifier required" errors 2015-11-27 15:51:11 +03:00
Mikhail Glukhikh
b2653ad1e9 Deprecated enum syntax removed: most compiler tests 2015-08-10 16:24:12 +03:00
Pavel V. Talanov
4e0d2bc23c CompileTimeConstantUtils: use getConstant instead of evaluate
Hacky way to avoid passing builtins into this code
2015-07-21 20:52:43 +03:00
Michael Bogdanov
cde74504d4 Test for obsolete kt5307 2014-09-24 17:12:27 +04:00
Denis Zharkov
3bc1c45fde Refactored tests for switch optimization of When expression 2014-04-25 18:17:36 +04:00
Denis Zharkov
95345a9bd4 Tests for switchOptimization: shuffled and added sparse version 2014-04-25 18:17:36 +04:00
Denis Zharkov
1952781e4b SwitchOptimization: generating `lookupswitch' opcode for 'when' in case of integral types 2014-04-25 18:17:36 +04:00
Denis Zharkov
c73533d214 Switch Optimization 2014-04-25 18:16:24 +04:00
Andrey Breslav
ea2b6e4546 Do not throw an exception when a when-statement with no else makes no match 2013-10-21 19:29:01 +04:00
Andrey Breslav
c017858f77 'Else' is not required in 'when' if Unit is expected 2013-09-13 22:04:46 +02:00
Alexander Udalov
41a416da60 Move blackBoxFile() testData to box/ directory
Delete all test methods (and empty test classes), since they'll be
auto-generated
2013-01-28 18:20:17 +04:00