Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Coroutines/Async vs Launch/Async/task-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 37
placeholder_text: TODO()
- name: test/Tests.kt
visible: false
visible: true
1 change: 0 additions & 1 deletion Coroutines/Async vs Launch/AsyncTask1/task-info.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion Coroutines/Async vs Launch/Launch/task-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 63
placeholder_text: TODO()
- name: test/output.txt
visible: false
visible: true
2 changes: 1 addition & 1 deletion Coroutines/Async vs Launch/lesson-info.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
content:
- Overview
- Introduction
- Async
- Launch
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ files:
length: 47
placeholder_text: ""
- name: test/output.txt
visible: false
visible: true
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 18
placeholder_text: i < 10
- name: test/output.txt
visible: false
visible: true
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ files:
length: 8
placeholder_text: ""
- name: test/Tests.kt
visible: false
visible: true
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ files:
length: 25
placeholder_text: ""
- name: test/output.txt
visible: false
visible: true
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 98
placeholder_text: TODO()
- name: test/output.txt
visible: false
visible: true
2 changes: 1 addition & 1 deletion Coroutines/Exception-Handling/lesson-info.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
content:
- Overview
- Introduction
- CoroutineExceptionHandler
2 changes: 1 addition & 1 deletion Coroutines/Recap/lesson-info.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
content:
- Overview
- Introduction
2 changes: 1 addition & 1 deletion DSL/DSL toolbox/Create a DSL/task-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 917
placeholder_text: // Implement your DSL here
- name: test/output.txt
visible: false
visible: true
2 changes: 1 addition & 1 deletion DSL/Infix functions/Define infix function/task-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 83
placeholder_text: // Define the infix function "pow" here
- name: test/Tests.kt
visible: false
visible: true
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 331
placeholder_text: class LazyPokemonProperty
- name: test/output.txt
visible: false
visible: true
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 476
placeholder_text: class AuditedProperty
- name: test/output.txt
visible: false
visible: true
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 171
placeholder_text: " var name: String"
- name: test/output.txt
visible: false
visible: true
2 changes: 1 addition & 1 deletion Delegation/Delegates/Create a delegate/task-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ files:
length: 39
placeholder_text: TODO()
- name: test/output.txt
visible: false
visible: true
2 changes: 1 addition & 1 deletion Delegation/Delegates/Overwrite a delegate/task-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 152
placeholder_text: class PeacefulPokemon
- name: test/output.txt
visible: false
visible: true
1 change: 0 additions & 1 deletion Delegation/Examples/task-info.yaml

This file was deleted.

1 change: 0 additions & 1 deletion Delegation/task1/task-info.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 374
placeholder_text: class Omniball
- name: test/output.txt
visible: false
visible: true
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 344
placeholder_text: class Pokeball
- name: test/output.txt
visible: false
visible: true
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 99
placeholder_text: "fun getHealthiestPokemon() {}"
- name: test/Tests.kt
visible: false
visible: true
2 changes: 1 addition & 1 deletion Generics/Reified keyword/Use reified types/task-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 137
placeholder_text: "fun filterByType(pokemons: List<Pokemon>)"
- name: test/Tests.kt
visible: false
visible: true
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 110
placeholder_text: "fun isInfoComplete(/* TODO */): Boolean"
- name: test/Tests.kt
visible: false
visible: true
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 103
placeholder_text: class Pokeball
- name: test/output.txt
visible: false
visible: true
2 changes: 1 addition & 1 deletion Generics/Variance/Create covariant generic/task-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 89
placeholder_text: class Pokeball
- name: test/output.txt
visible: false
visible: true
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Inline Classes vs Type Aliases

Both, tools introduce a new type and represent the underlying type.
Both tools introduce a new type and represent the underlying type.
Hence, both may be treated as a wrapper.

## Recap Type Alias
Expand Down
13 changes: 9 additions & 4 deletions Inline/Inline Classes/Introduction/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@ They are a subset of value-based classes like the primitives Int, Long, etc.
Inline classes behave differently compared to regular classes.
They are represented both as the underlying values type and as a wrapper.
Hence, they do not have a stable identity.
Therefor, reference equality ( === ) is not provided.
Therefore, reference equality ( === ) is not provided.

## Exmaple: Int
## Example: Int

The kotlin Int class may be represented as the primitive **int** in the JVM platform or as the boxed Integer class.
The Kotlin Int class may be represented as the primitive **int** in the JVM platform or as the boxed Integer class.

Inline classes are a tool to allow developers to define value-based classes to provide this behavior.

## Declaration

To declare an inline class the *value* keyword is used. In addition, the **JvmInline** annotation must be annotated.
To declare an inline class the *value* keyword is used. In addition, the `@JvmInline` annotation must be added:

```kotlin
@JvmInline
value class PositiveId(private val value: Long)
```

The inline classes force to initialize a single property in the primary constructor.
Not more, not less.
Expand Down
2 changes: 1 addition & 1 deletion Inline/Inline Classes/lesson-info.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
content:
- Introduction
- Inline classes vs Type Aliases
- Examples
- Tasks
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 269
placeholder_text: // Define operators here
- name: test/Tests.kt
visible: false
visible: true
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 210
placeholder_text: // Define collection operators here
- name: test/Tests.kt
visible: false
visible: true
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ files:
length: 192
placeholder_text: // Implement the invoke operator here
- name: test/output.txt
visible: false
visible: true
1 change: 0 additions & 1 deletion Serialization/kotlinx.serialization/lesson-info.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
type: framework
content:
- Introduction
- Basics
Expand Down
4 changes: 0 additions & 4 deletions Types/Kotlin type hierarchy/Introduction/src/Main.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
fun main() {

}

fun test(a: Nothing) {

}
8 changes: 4 additions & 4 deletions course-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ solutions_hidden: true
content:
- Types
- Inline
- Generics
- Coroutines
- Flow
- Delegation
- Operators
- Serialization
- Coroutines
- Flow
- Generics
- DSL
- Serialization
environment_settings:
jvm_language_level: JDK_1_8