Skip to content

Files

Latest commit

 

History

History
23 lines (14 loc) · 419 Bytes

PreferToOverPairSyntax.md

File metadata and controls

23 lines (14 loc) · 419 Bytes

Pattern: Use of Pair constructor

Issue: -

Description

Detects the usage of the Pair constructor to create pairs of values. Use the to syntax instead.

Example of incorrect code:

val pair = Pair(1, 2)

Example of correct code:

val pair = 1 to 2

Further Reading