withSupplied

inline fun <T1, R> withSupplied(suppliedType1: SuppliedType, block: () -> R): R(source)

Executes block in a scope where the supplied type parameter T1 is bound to suppliedType1.

Within block, suppliedTypeOf calls and suppliable calls can use T1 as if it were a concrete type described by suppliedType1. This function is an intrinsic stub replaced by the supplied types compiler plugin. If the plugin is not applied, calling it throws IllegalStateException.

Return

The result returned by block.

Parameters

suppliedType1

The SuppliedType value to bind to T1 for the duration of block.

block

The code to execute with T1 supplied. Invoked exactly once.

Type Parameters

T1

The supplied type parameter to bind in block. Must be specified as an explicit type argument at the call site and must refer to a Supply-annotated type parameter visible in the enclosing scope.

R

The return type of block, inferred from its result.


inline fun <T1, T2, R> withSupplied(suppliedType1: SuppliedType, suppliedType2: SuppliedType, block: () -> R): R(source)

Executes block in a scope where the supplied type parameters T1 and T2 are bound to suppliedType1 and suppliedType2, respectively.

Within block, suppliedTypeOf calls and suppliable calls can use T1 and T2 as if they were concrete types described by the corresponding SuppliedType arguments. This function is an intrinsic stub replaced by the supplied types compiler plugin. If the plugin is not applied, calling it throws IllegalStateException.

Return

The result returned by block.

Parameters

suppliedType1

The SuppliedType value to bind to T1 for the duration of block.

suppliedType2

The SuppliedType value to bind to T2 for the duration of block.

block

The code to execute with T1 and T2 supplied. Invoked exactly once.

Type Parameters

T1

The first supplied type parameter to bind in block. Must be specified as an explicit type argument at the call site and must refer to a Supply-annotated type parameter visible in the enclosing scope.

T2

The second supplied type parameter to bind in block. Must be specified as an explicit type argument at the call site and must refer to a Supply-annotated type parameter visible in the enclosing scope.

R

The return type of block, inferred from its result.


inline fun <T1, T2, T3, R> withSupplied(suppliedType1: SuppliedType, suppliedType2: SuppliedType, suppliedType3: SuppliedType, block: () -> R): R(source)

Executes block in a scope where the supplied type parameters T1, T2, and T3 are bound to suppliedType1, suppliedType2, and suppliedType3, respectively.

Within block, suppliedTypeOf calls and suppliable calls can use T1, T2, and T3 as if they were concrete types described by the corresponding SuppliedType arguments. This function is an intrinsic stub replaced by the supplied types compiler plugin. If the plugin is not applied, calling it throws IllegalStateException.

Return

The result returned by block.

Parameters

suppliedType1

The SuppliedType value to bind to T1 for the duration of block.

suppliedType2

The SuppliedType value to bind to T2 for the duration of block.

suppliedType3

The SuppliedType value to bind to T3 for the duration of block.

block

The code to execute with T1, T2, and T3 supplied. Invoked exactly once.

Type Parameters

T1

The first supplied type parameter to bind in block. Must be specified as an explicit type argument at the call site and must refer to a Supply-annotated type parameter visible in the enclosing scope.

T2

The second supplied type parameter to bind in block. Must be specified as an explicit type argument at the call site and must refer to a Supply-annotated type parameter visible in the enclosing scope.

T3

The third supplied type parameter to bind in block. Must be specified as an explicit type argument at the call site and must refer to a Supply-annotated type parameter visible in the enclosing scope.

R

The return type of block, inferred from its result.