fi-0066: Constant overflows type {:#fi-0066}

A constant value cannot fall outside of the range inherent to its underlying type:

{% include “docs/reference/fidl/language/error-catalog/label/_bad.md” %}

{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/bad/fi-0066.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}

The problem may be fixed either by changing the value to fit within the type's range:

{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}

{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0066-a.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}

Or otherwise by changing to the type to accommodate the currently overflowing value:

{% include “docs/reference/fidl/language/error-catalog/label/_good.md” %}

{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0066-b.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}

This error exclusively concerns FIDL's numeric types, all of which have the capacity to overflow. The ranges are sourced from the C++ std::numeric_limits interface and are as follows:

TypeMinimumMaximum
int8-128127
int163276832767
int3221474836482147483647
int6492233720368547758089223372036854775807
uint80255
uint16065536
uint3204294967295
uint64018446744073709551615
float32-3.40282e+383.40282e+38
float64-1.79769e+3081.79769e+308