mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-29 22:02:42 +01:00
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>
Carbon: Generics
This directory contains the collection of documents describing the generics feature of Carbon:
- Overview - A high-level description of the generics design, with pointers to other design documents that dive deeper into individual topics.
- Goals - The motivation and principles guiding the design direction.
- Terminology - A glossary establishing common terminology for describing the design.
- Detailed design - In depth description of how generic type parameters work.
Rejected alternatives- not implemented yet