Skip to content

Commit fdc393e

Browse files
committed
Apply .gitignore
1 parent 94268a7 commit fdc393e

File tree

4 files changed

+3
-352
lines changed

4 files changed

+3
-352
lines changed

.gitignore

Lines changed: 0 additions & 11 deletions
This file was deleted.

content/.obsidian/workspace.json

Lines changed: 0 additions & 338 deletions
This file was deleted.

content/Kotlin Contract.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ comments: true
88
---
99
# Kotlin Contract
1010
## 배경
11-
```
11+
```kotlin
1212
// 문자열이 유효한지 (null도 아니고 비어있지도 않은지) 검사하는 함수
1313
fun isValid(value: String?): Boolean {
1414
return value != null && value.isNotEmpty()
@@ -27,7 +27,7 @@ fun printVerifiedLength(text: String?) {
2727
- 이런 문제를 해결하기 위해 Kotlin Contract 탄생하게 되었다.
2828

2929
## How to use
30-
```
30+
```kotlin
3131
fun isValid(value: String?): Boolean {
3232
contract {
3333
returns(true) implies (value != null)
@@ -38,7 +38,7 @@ fun isValid(value: String?): Boolean {
3838
- 결과값을 true로 반환하면, value가 null이 아니라는 정보를 [[Compiler]]에게 전달한다.
3939

4040
## 쓰임새
41-
```
41+
```kotlin
4242
fun runBlock(block: () -> Unit) {
4343
// '이 블록은 여기서, 정확히 한 번 실행된다'고 계약
4444
contract {

0 commit comments

Comments
 (0)