Effects: add DSL for declaration of contracts

- Introduce DSL for declaration of contracts. Functions and classes in
this DSL do not bear any computational semantics: in fact, they all do
not exist on runtime. Whole work of extracting semantics from such calls
is done by special parts of compiler

- To make distinguishing those declarations more robust and
convenient, introduce internal annotation @ContractsDSL

- Turn off InlineChecker inside contracts DSL. We do this, because some
functions from DSL should take any possible lambda, so we can't write
any type besides 'Function<R>'. However, InlineChecker will complain if
we will pass inlined lambda in such function -- though, this is false
positive because we know that functions from contracts DSL will never be
executed

- Change testData on HierarchyTestWithLib, where new enum from
kotlin.internal changed expected output

==========
Effect System introduction: 7/18
This commit is contained in:
Dmitry Savvinov
2017-10-03 15:02:34 +03:00
parent b347e31fc4
commit 2c0ef592e6
5 changed files with 99 additions and 5 deletions
+6 -5
View File
@@ -9,9 +9,11 @@
<node text="PrintMode in JTable (javax.swing)"/>
<node text="ElementType (java.lang.annotation)"/>
<node text="State in Thread (java.lang)"/>
<node text="RetentionPolicy (java.lang.annotation)"/>
<node text="Type in Window (java.awt)"/>
<node text="Kind in KParameter (kotlin.reflect)"/>
<node text="RetentionPolicy (java.lang.annotation)"/>
<node text="InvocationKind (kotlin.internal.contracts)"/>
<node text="One ()"/>
<node text="G ()"/>
<node text="FileWalkDirection (kotlin.io)"/>
<node text="OnErrorAction (kotlin.io)"/>
<node text="RegexOption (kotlin.text)"/>
@@ -22,9 +24,8 @@
<node text="AnnotationTarget (kotlin.annotation)"/>
<node text="AnnotationRetention (kotlin.annotation)"/>
<node text="State (kotlin.collections)"/>
<node text="DeprecationLevel (kotlin)"/>
<node text="LazyThreadSafetyMode (kotlin)"/>
<node text="One ()"/>
<node text="G ()"/>
<node text="DeprecationLevel (kotlin)"/>
<node text="Kind in KParameter (kotlin.reflect)"/>
</node>
</node>