<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/BooleanLiteralType",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s18BooleanLiteralTypea"
  },
  "title" : "BooleanLiteralType"
}
-->

# BooleanLiteralType

The default type for an otherwise-unconstrained Boolean literal.

```
typealias BooleanLiteralType = Bool
```

## Discussion

When you create a constant or variable using one of the Boolean literals
`true` or `false`, the resulting type is determined by the
`BooleanLiteralType` alias. For example:

```
let isBool = true
print("isBool is a '\(type(of: isBool))'")
// Prints "isBool is a 'Bool'"
```

The type aliased by `BooleanLiteralType` must conform to the
`ExpressibleByBooleanLiteral` protocol.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)