Skip to content

Files

Latest commit

 

History

History
27 lines (18 loc) · 471 Bytes

RedundantExplicitType.md

File metadata and controls

27 lines (18 loc) · 471 Bytes

Pattern: Redundant explicit type

Issue: -

Description

Local properties do not need their type to be explicitly provided when the inferred type matches the explicit type.

Example of incorrect code:

fun function() {
val x: String = "string"
}

Example of correct code:

fun function() {
val x = "string"
}

Further Reading