Commit Graph

23 Commits

Author SHA1 Message Date
Denis Zharkov
58caff3411 Minor. Add tests checking not-null assertions
More precisely these tests check cases when expected type
was somehow obtained from captured type (in member scope with projections)
2015-12-28 07:44:56 +03:00
Yan Zhulanow
9d1af5a17e Fix tests: "infix modifier required" and "operator modifier required" errors 2015-11-27 15:51:11 +03:00
Yan Zhulanow
a3ff3ffc45 Fix tests: "Placing function type parameters after the function name" error 2015-11-27 15:51:11 +03:00
Mikhail Glukhikh
4e44466cf9 Exposed visibility deprecation warnings made errors + relevant test fixes 2015-11-20 15:21:01 +03:00
Alexander Udalov
baaa3ef50a Remove KotlinSignature annotations from project code 2015-10-13 20:29:16 +03:00
Dmitry Jemerov
7c20630272 diagnostics for deprecated syntax of function type parameter list 2015-10-06 16:20:47 +02:00
Denis Zharkov
d19cb747be Emit not-null assertions for enhanced types 2015-07-15 10:01:14 +03:00
Denis Zharkov
00e41fc238 Fix testData after types enhancement 2015-07-09 16:36:45 +03:00
Dmitry Jemerov
4bdf598bfe compiler testdata: s/trait/interface 2015-05-12 19:43:17 +02:00
Pavel V. Talanov
06916d98c6 default -> companion: replace all mentions of default and default object 2015-03-17 15:47:39 +03:00
Pavel V. Talanov
59f192ef90 Replace 'class object' with 'default object' in renderers and test data
Includes changes to decompiled text
Old syntax is used in builtins and project code for now
2015-03-06 19:36:54 +03:00
Andrey Breslav
f1c66fa6b0 Assertions on approximation of platform types to non-null types
- for most expressions (ExpressionCodegen.genQualified)
2014-10-13 15:38:13 +04:00
Alexander Udalov
d8c5b0236d Fix incorrect usage of mapReturnType in param assertions 2013-12-30 04:15:24 +04:00
Alexey Sedunov
1f8d42ab49 Fix nullability check (in case of explicitly nullable types constructed from ype variables) 2013-02-13 18:23:37 +04:00
Evgeny Gerashchenko
b9e5704057 Updated test data and stdlib sources. 2013-02-13 18:08:37 +04:00
Alexander Udalov
90d255e7da Simplify tests on not-null assertions
No need to call blackBoxFile() on a useless test data file. Also creating
environment logic is simplified
2013-02-11 02:01:41 +04:00
Alexander Udalov
9df3c22097 Kill blackBoxFile()
If your test is supposed to use blackBoxFile(), maybe it should be placed into
box/boxWithStdlib directory
2013-02-11 02:01:41 +04:00
Alexander Udalov
1f4dd8cd33 Add CodegenUtil.isNullableType(), fix assertions
JetType.isNullable() is not accurate when the type denotes a type parameter:
a parameter can be not null (isNullable=false), but its upper bound can be
nullable (<T: Any?>), so null may appear in the value of such type. Therefore
it's preferred to use a special check (isNullableType()) in codegen from now on

Do not generate assertion for parameters of not-null types which have a
nullable upper bound + the same with Java method calls

Also fix Intrinsics class internal name in tests

 #KT-3313 Fixed
2013-02-05 21:52:29 +04:00
Alexander Udalov
8eb6047972 Fix assertions generation for substituted members 2013-02-05 16:26:56 +04:00
Alexander Udalov
c9984c3d06 Generate not-null assertions on method parameters
Intrinsics.checkParameterIsNotNull() gets its caller's class and method names
from the stack trace to render them in an exception message.

Fix codegen tests because now it's now allowed to pass null to non-null
argument in tests
2012-10-08 19:13:20 +04:00
Alexander Udalov
bf779b4ca5 Generate not-null assertions only for descriptors coming from Java
Introduce BindingContext.IS_DECLARED_IN_JAVA, store that info in
JavaDescriptorResolver
2012-10-08 19:03:29 +04:00
Alexander Udalov
fcbc95bbb4 Generate not-null assertions after getting a field 2012-10-08 14:11:57 +04:00
Alexander Udalov
95ec2448eb Generate not-null assertions after method calls
If a method comes from Java and is annotated as returning NotNull, after
calling it we should check if it actually returned something other than null.
Introduce checkReturnedValueIsNotNull() in jet/runtime/Intrinsics which does
exactly that.

CallableMethod's invoke() and invokeDefault() are now private, use asserted
versions instead
2012-10-08 14:11:56 +04:00