Files
carbon-lang/docs
f63169608e Implicit conversions (#820)
Proposal to support a limited set of implicit conversions.

This would generally permit only implicit conversions that are lossless and semantics-preserving. In particular, this proposal allows:

-   Conversion from an integer type to a wider integer type of the same signedness, and from an unsigned integer type to a wider signed integer type.
-   Conversion from an integer type to a floating-point type that has enough mantissa bits to exactly represent all integers in the source type.
-   Conversion from integer literals to integer and floating-point types that can represent them.
-   Conversion from floating-point literals to floating-point types that can represent them.
-   Conversions required for generics: conversions of values between facet types, and conversions of types between type-of-types, as described in the generics proposals.
-   Conversions required for inheritance: derived-to-base conversions for class pointers and class values.

Other conversions, such as lossy conversions between arithmetic types and conversions between bool and other types are not supported.

Co-authored-by: josh11b <josh11b@users.noreply.github.com>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Geoff Romer <gromer@google.com>
2021-09-21 15:16:16 -07:00
..
2021-09-21 15:16:16 -07:00
2020-10-14 10:52:24 -07:00
2021-09-21 09:45:35 -07:00

Docs

This directory contains current, accepted documentation underpinning Carbon. These documents cover all aspects of Carbon ranging from the project down to detailed designs for specific language features.

If you're trying to learn more about Carbon, we recommend starting at /README.md.