Compare commits

...

1 Commits

Author SHA1 Message Date
Pavel Punegov
6222705beb Move kotlin.native.Throws to common stdlib and rename to NativeThrows.
Move native concurrent annotations to subpackage
2019-02-21 19:51:54 +03:00
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package kotlin.native
import kotlin.reflect.KClass
/**
* This annotation indicates what exceptions should be declared by a function when compiled to a platform method.
*
* When compiling to Objective-C/Swift framework, methods having or inheriting this annotation are represented as
* `NSError*`-producing methods in Objective-C and as `throws` methods in Swift.
* When such a method called through framework API throws an exception, it is either propagated as
* `NSError` or considered unhandled (if exception `is` [kotlin.Error] or [kotlin.RuntimeException]).
* In any case exception is not checked to be instance of one of the [exceptionClasses].
*
* @property exceptionClasses the list of checked exception classes that may be thrown by the function.
*/
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.CONSTRUCTOR)
@Retention(AnnotationRetention.SOURCE)
@OptionalExpectation
public expect annotation class NativeThrows(vararg val exceptionClasses: KClass<out Throwable>)