Commit Graph

15 Commits

Author SHA1 Message Date
pyos
847e287bd6 JVM_IR: add $assertionsDisabled when an inlined function uses it
NOTE: jvmCrossinlineLambdaDeclarationSite.kt is muted because the
inliner does not remap references to an anonymous object's parent
class after regenerating it. Unlike the JVM backend, JVM_IR uses the
top level named class' assertion status for all inner classes. (The
test used to pass because the lambda in `inline fun call` read the
`$assertionsDisabled` field of `CrossinlineLambdaContainer`, which
was not reloaded after changing the assertion status of package `test`.)
2019-10-21 21:05:18 +03:00
pyos
bc4be53569 JVM: generate $assertionsDisabled before inlining the node
This fixes the problem where compiling a class initializer that contains
a call to an `assert`ing function in a separate module causes the
assertion to always be enabled (i.e. the attached test used to fail in
CompileKotlinAgainstInlineKotlin mode).
2019-10-11 14:54:52 +03:00
Georgy Bronnikov
7ede26e8f4 IrCompileKotlinAgainstInlineKotlin tests 2019-09-06 09:19:57 +03:00
Mikhael Bogdanov
1eda42cb88 JVM_IR. Generate SMAP information for anonymous classes
#KT-28092 Fixed
2019-08-08 12:02:50 +02:00
Mikhael Bogdanov
a444a40849 JVM_IR. Basic support of 'inlineCallSiteInfo' 2019-08-08 12:02:49 +02:00
Steven Schäfer
43a27ab58c (Un)mute tests 2019-08-07 10:34:43 +02:00
Ilmir Usmanov
1e4b7e1ef1 Put $assertionDisabled field into inline-site's class
The generated code is more inline with java, and we avoid the error of
accessing package-private field outside of the package.
However, this changes semantics a bit. Now, a user should set assertion
status of inline-site's package, instead of inline function's one.
 #KT-28317: Fixed
2019-02-18 12:39:03 +03:00
Mikhael Bogdanov
1217d3591b Specify JVM target backend for test with '::class.java' usage 2018-12-21 16:09:04 +01:00
Pavel Punegov
2ff6047845 Update ignore tag for Native backend 2018-08-28 13:48:43 +03:00
Ilmir Usmanov
1c098bf5cf Minor. Fix test 2018-08-15 14:23:33 +03:00
Ilmir Usmanov
b4189d9e85 Minor. Use more granular assertion levels in assertion tests 2018-08-15 14:23:30 +03:00
Mikhael Bogdanov
ddf6bdffcf Move jvm ir tests to jvm ones 2018-08-06 13:57:43 +03:00
Mikhael Bogdanov
9ccb25789b Unmute jvm-ir inline tests 2018-08-02 13:19:24 +02:00
Mikhael Bogdanov
e149cbe852 Mute failed jvm ir tests 2018-06-28 12:26:41 +02:00
Ilmir Usmanov
f568149863 Implement new assert semantics in back-end
Previously, assert was just a regular function and its argument used to
be computed on each call (even if assertions are disabled on JVM).
This change adds support for 3 new behaviours of assert:
* always-enable (independently from -ea on JVM)
* always-disable (independently from -ea JVM)
* runtime/jvm (compile the calls like javac generates assert-operator)
* legacy (leave current eager semantics) - this already existed

Default behaviour is legacy for now.

The behavior is changed based on -Xassertions flag.
 #KT-7540: Fixed
2018-05-21 20:43:37 +03:00