<!--
{
  "documentType" : "article",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/default-literal-types",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Default Literal Types"
}
-->

# Default Literal Types

Type aliases representing the concrete type that a literal takes when no other type
information is provided.

## Overview

This example declares the `numberOfCookies` constant, using an integer literal to
express its value:

```swift
let numberOfCookies = 5
// type(of: numberOfCookies) == Int.self
```

When a literal expression is written with no type information, Swift uses these type
aliases to determine what type to use for the expression. In this case, the `numberOfCookies`
constant has the default type for an integer literal, `Int`, as designated by the
`IntegerLiteralType` type alias.

## Topics

### Basic Values

[`BooleanLiteralType`](/documentation/Swift/BooleanLiteralType)

The default type for an otherwise-unconstrained Boolean literal.

[`IntegerLiteralType`](/documentation/Swift/IntegerLiteralType)

The default type for an otherwise-unconstrained integer literal.

[`FloatLiteralType`](/documentation/Swift/FloatLiteralType)

The default type for an otherwise-unconstrained floating-point literal.

### Strings and Text

[`StringLiteralType`](/documentation/Swift/StringLiteralType)

The default type for an otherwise-unconstrained string literal.

[`ExtendedGraphemeClusterType`](/documentation/Swift/ExtendedGraphemeClusterType)

The default type for an otherwise-unconstrained Unicode extended
grapheme cluster literal.

[`UnicodeScalarType`](/documentation/Swift/UnicodeScalarType)

The default type for an otherwise-unconstrained unicode scalar literal.



---

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)