Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Add Contracts to DSL Builders #99

Closed
nbilyk opened this issue Jan 8, 2019 · 1 comment
Closed

Add Contracts to DSL Builders #99

nbilyk opened this issue Jan 8, 2019 · 1 comment

Comments

@nbilyk
Copy link
Collaborator

nbilyk commented Jan 8, 2019

Builder:

@ExperimentalContracts
fun Owned.textArea(init: ComponentInit<TextAreaImpl> = {}): TextAreaImpl {
	contract {
		callsInPlace(init, kotlin.contracts.InvocationKind.EXACTLY_ONCE)
	}
	val t = TextAreaImpl(this)
	t.init()
	return t
}

See if there is a way to not need the @ExperimentalContracts annotation.
The documentation mentions the compiler flag: -Xuse-experimental=kotlin.contracts.ExperimentalContracts

@fuzzyweapon fuzzyweapon self-assigned this Jan 8, 2019
@nbilyk
Copy link
Collaborator Author

nbilyk commented Jan 8, 2019

When we start using Contracts update the Style Guide in the Wiki

@fuzzyweapon fuzzyweapon removed their assignment Feb 28, 2019
@nbilyk nbilyk closed this as completed in b7826da Jul 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants