Skip to content

Files

Latest commit

 

History

History
27 lines (18 loc) · 511 Bytes

HasPlatformType.md

File metadata and controls

27 lines (18 loc) · 511 Bytes

Pattern: Implicit platform type

Issue: -

Description

Platform types must be declared explicitly in public APIs to prevent unexpected errors.

Example of incorrect code:

class Person {
  fun apiCall() = System.getProperty("propertyName")
}

Example of correct code:

class Person {
  fun apiCall(): String = System.getProperty("propertyName")
}

Further Reading