E4095

E4095#

Integer literal is out of range.

Integer literals can be used to initialize Byte, Int16, Int, Int64 and their unsigned variants. The range of these types are as follows:

Type

Minimum value

Maximum value

Byte

0

255

Int16

-32768

32767

UInt16

0

65536

Int

-2147483648

2147483647

UInt

0

4294967295

Int64

-9223372036854775808

9223372036854775807

UInt64

0

18446744073709551615

错误示例#

fn main {
  let byte : Byte = 256
}

建议#

You should either use a value that falls into the range of corresponding type, or adjust the type to accommodate the value.

fn main {
  let int : Int = 256
}