Commit Graph

37 Commits

Author SHA1 Message Date
Dmitriy Novozhilov a26df4b4c6 [NI] Update test data for spec tests 2019-03-25 23:04:50 +03:00
Dmitriy Novozhilov ca0e66bafc [NI] Refactor compiler representation of integer literals types
Add `IntegerLiteralTypeConstructor` that holds types, that can take
  integer literal with given value. It has two supertypes
  (`Number` and `Comparable<IntegerLiteralType>`) and have
  special rules for subtyping, `intersect` and `commonSuperType`
  functions with primitive number:

Example (assuming that ILT holds Int type):
* ILT <: Int
* Int :> ILT
* ILT intersect Int = Int
* commonSuperType(ILT, Int) = Int

#KT-30293 Fixed
#KT-30446 Fixed
2019-03-25 18:55:36 +03:00
victor.petukhov 70c35f4186 Introduce warning about implicitly inferred Nothing as a type parameter
^KT-20849 Fixed
2019-03-15 19:28:38 +03:00
Dmitriy Novozhilov 77c98bef4d Fix recursion in contract declaration analysis. KT-26386 Fixed
Issue fixed only in old inference
2019-03-07 14:35:18 +03:00
Dmitriy Novozhilov d0462859bf Minor. Fix reporting diagnostic in contract with callable reference 2019-03-07 14:35:13 +03:00
Dmitriy Novozhilov 2f5843f764 Move detecting of illegal call of contract function into call checker
(#KT-26153, #KT-26191) fixed
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov 54e5cce9be Prohibit declaring multiple callsInPlace contract on same lambda.
#KT-26150 fixed
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov 84da8b6279 Report CONTRACT_NOT_ALLOWED diagnostic on extension property getter/setter
KT-27090
2019-03-01 14:50:46 +03:00
victor.petukhov bd03ecf4a0 Rename helper file with typealias samples for spec tests 2019-02-28 14:55:41 +03:00
victor.petukhov 2bcdadf17f Add positive diagnostic tests for smartcasts from nullability condition using if expression 2019-02-14 13:11:14 +03:00
victor.petukhov 06b5a42d0d Improve test exceptions fixation:
- exceptions is analyzed if it's specified explicitly only,
- compute test case number for diagnostic tests in which an exception is thrown.
2019-02-14 12:31:43 +03:00
victor.petukhov ec8a6cbe9c Alphabetical sort wrapped intersection types for rendered diagnostics 2019-02-14 12:31:43 +03:00
victor.petukhov acd6d354dc Support several spec places to which tests are linked and require specify spec version for each test 2019-02-14 12:31:43 +03:00
victor.petukhov 46bd5ba107 Add alphabetical sorting diagnostics with same ranges 2019-02-14 12:31:42 +03:00
Dmitry Savvinov e483f83666 Make 'is'-operator more stupid
Consider following expression: 'call() is Foo'. Suppose that we know
something about the 'call()', e.g. 'returns(foo) -> <condition>'

Previously, we've tried to re-use knowledge about 'call()', constructing
some smart clause, like 'returns(true) -> foo is Foo && <condition>'.

The conceptual error here is that *we can't* argue that <condition>
holds. Imagine that 'call()' actually has unspecified 'returns(foo2) ->
<!condition>', and 'foo2 is Foo' also holds. Then we would get
'returns(true) -> foo2 is Foo && <condition>' <=> 'returns(true) ->
<condition>' for the whole call, which is not correct.

More concrete example would be something like:
'if (!x.isNullOrEmpty() is Boolean)'

^KT-27241 Fixed
2019-01-17 12:47:27 +03:00
victor.petukhov 04fa6e8ab4 Add tests for local variables with type parameters (KT-8341) 2018-12-25 17:51:05 +03:00
victor.petukhov a72515d822 Add tests for constructors of annotation classes with JvmOverloads (KT-25702) 2018-12-25 17:50:55 +03:00
victor.petukhov b9d1825765 Implement tests exceptions fixation mechanism 2018-12-07 18:35:43 +03:00
victor.petukhov f5d44003cd Add tests for type annotations with unresolved reference and invalid target (KT-28424, KT-28449) 2018-11-27 13:55:12 +03:00
victor.petukhov 68c1e70b74 Add real literals spec tests 2018-11-23 17:24:13 +03:00
victor.petukhov 73ecde6cc3 Add boolean literals diagnostic spec tests 2018-11-23 17:24:01 +03:00
victor.petukhov 64f531fc93 Reorganize spec tests infrastructure code
- Add the tests mute system for the diagnostic tests
- Move the code for the test info parsing to the separate package `parsers`
- Unification of the `linked` and `not linked` spec tests
- Package structure is refactored
- Change the multiline comment format with a test information
- Actualize `PrintSpecTestsStatistic`
- Other different code improvements
2018-11-23 17:23:41 +03:00
victor.petukhov b86211b434 Add spec tests for integer literals 2018-10-12 17:31:24 +03:00
victor.petukhov 4ee0a666cb Temporary mute test with FrontEndException (KT-26386) 2018-10-09 09:59:56 +03:00
victor.petukhov e90cf4b955 Actualize test with return expression in contract description (implies) 2018-10-09 09:59:35 +03:00
victor.petukhov 30fc76a602 Remove redundant directives to contracts use 2018-10-03 13:49:32 +03:00
victor.petukhov 8538866778 Add few tests for contracts
- Contracts in getter/setter (unexpected behaviour)
- Check smartcasts when non-null assertion for a contract function is used
- Check work of contracts when type parameter of the callsInPlace is specify explicitly
- Check smartcasts working if type checking for contract function is used
2018-10-03 13:29:13 +03:00
victor.petukhov ecb3f10e47 Add 'mute' concept: move tests with unexpected behaviour to the corresponding folder 2018-10-03 13:26:37 +03:00
victor.petukhov 84dc28374c Add multilevel sections support and corresponding renaming 2018-10-03 13:26:29 +03:00
victor.petukhov 023e4e3a0e Actualize tests after KT-27260 fix 2018-10-02 11:49:10 +03:00
victor.petukhov 50d9dbbfc1 Fix inheritance in stdlib contracts code (KT-26409) 2018-09-12 12:34:15 +03:00
victor.petukhov cba99a1e67 Move test to negatives after fix KT-26382 2018-09-12 12:32:57 +03:00
victor.petukhov e082fe19ea Actualize contracts diagnostic spec tests after 051ad0f79e 2018-09-05 18:04:58 +03:00
victor.petukhov 110bc7412d Fix name of 'controlflow' folder with contract tests 2018-08-31 17:27:51 +03:00
victor.petukhov 8d91e5998d Add spec tests for contracts 2018-08-31 17:15:51 +03:00
victor.petukhov ecf8b88c4c Add 'not linked' kind of spec tests 2018-08-31 17:15:40 +03:00
victor.petukhov bed4c5f2f0 Add diagnostic spec tests for 'When expression' section 2018-08-14 17:34:15 +03:00