Skip to content

explicit_type_interface

Ian Applebaum edited this page Jun 13, 2020 · 1 revision

Explicit Type Interface

Properties should have a type interface

  • Identifier: explicit_type_interface
  • Enabled by default: Disabled
  • Supports autocorrection: No
  • Kind: idiomatic
  • Analyzer rule: No
  • Minimum Swift compiler version: 3.0.0
  • Default configuration: warning, excluded: [], allow_redundancy: false

Non Triggering Examples

class Foo {
  var myVar: Int? = 0
}
class Foo {
  let myVar: Int? = 0
}
class Foo {
  static var myVar: Int? = 0
}
class Foo {
  class var myVar: Int? = 0
}

Triggering Examples

class Foo {
  var myVar = 0
}
class Foo {
  let mylet = 0
}
class Foo {
  static var myStaticVar = 0
}
class Foo {
  class var myClassVar = 0
}
class Foo {
  let myVar = Int(0)
}
class Foo {
  let myVar = Set<Int>(0)
}
Clone this wiki locally