소스 검색

Change remaining uses of `Bool` to `bool`, following #750. (#1901)

The most significant change here is that explorer now uses the chosen spelling
rather than the old `Bool` spelling. Also update a few documentation examples
and some skeletal design docs to use the chosen spelling.
Richard Smith 3 년 전
부모
커밋
e26bc32343
39개의 변경된 파일81개의 추가작업 그리고 77개의 파일을 삭제
  1. 1 1
      common/fuzzing/proto_to_carbon.cpp
  2. 3 3
      docs/design/classes.md
  3. 1 1
      docs/design/generics/goals.md
  4. 6 6
      docs/design/generics/overview.md
  5. 1 1
      docs/design/generics/terminology.md
  6. 5 5
      docs/design/name_lookup.md
  7. 17 13
      docs/design/primitive_types.md
  8. 1 1
      docs/project/principles/error_handling.md
  9. 1 1
      docs/project/principles/library_apis_only.md
  10. 1 1
      explorer/ast/expression.cpp
  11. 4 4
      explorer/data/prelude.carbon
  12. 2 2
      explorer/interpreter/interpreter.cpp
  13. 1 1
      explorer/interpreter/value.cpp
  14. 1 1
      explorer/syntax/lexer.lpp
  15. 1 1
      explorer/testdata/basic_syntax/not_compare_precedence.carbon
  16. 1 1
      explorer/testdata/comparison/custom_equality.carbon
  17. 1 1
      explorer/testdata/comparison/fail_empty_struct.carbon
  18. 1 1
      explorer/testdata/function/auto_return/fail_direct_recurse.carbon
  19. 2 2
      explorer/testdata/generic_class/fail_argument_deduction.carbon
  20. 2 2
      explorer/testdata/generic_class/fail_point_equal.carbon
  21. 1 1
      explorer/testdata/generic_function/apply.carbon
  22. 1 1
      explorer/testdata/generic_function/fail_type_deduction_mismatch.carbon
  23. 1 1
      explorer/testdata/global_variable/fail_init_type_mismatch.carbon
  24. 2 2
      explorer/testdata/if_else/convert_condition.carbon
  25. 2 2
      explorer/testdata/if_expression/convert_condition.carbon
  26. 1 1
      explorer/testdata/if_expression/if_then_else.carbon
  27. 2 2
      explorer/testdata/impl/fail_ambiguous_impl_generic.carbon
  28. 1 1
      explorer/testdata/impl/fail_param_interface_in_impl.carbon
  29. 2 2
      explorer/testdata/operators/shortcircuit_and.carbon
  30. 2 2
      explorer/testdata/operators/shortcircuit_and_no_shortcircuit.carbon
  31. 2 2
      explorer/testdata/operators/shortcircuit_or.carbon
  32. 2 2
      explorer/testdata/operators/shortcircuit_or_no_shortcircuit.carbon
  33. 1 1
      explorer/testdata/random/random.carbon
  34. 2 2
      explorer/testdata/returned_var/fail_returned_var_type_mismatch.carbon
  35. 1 1
      explorer/testdata/struct/equality.carbon
  36. 1 1
      explorer/testdata/struct/equality_false.carbon
  37. 1 1
      explorer/testdata/struct/fail_equality_type.carbon
  38. 2 2
      explorer/testdata/while/convert_condition.carbon
  39. 1 1
      third_party/examples/re2/re2.carbon

+ 1 - 1
common/fuzzing/proto_to_carbon.cpp

@@ -321,7 +321,7 @@ static auto ExpressionToCarbon(const Fuzzing::Expression& expression,
     }
 
     case Fuzzing::Expression::kBoolTypeLiteral:
-      out << "Bool";
+      out << "bool";
       break;
 
     case Fuzzing::Expression::kBoolLiteral: {

+ 3 - 3
docs/design/classes.md

@@ -1755,8 +1755,8 @@ declaration with all of the optional parameters in an option struct:
 ```
 fn SortIntVector(
     v: Vector(i32)*,
-    options: {.stable: Bool = false,
-              .descending: Bool = false} = {}) {
+    options: {.stable: bool = false,
+              .descending: bool = false} = {}) {
   // Code using `options.stable` and `options.descending`.
 }
 
@@ -1780,7 +1780,7 @@ We might instead support destructuring struct patterns with defaults:
 ```
 fn SortIntVector(
     v: Vector(i32)*,
-    {stable: Bool = false, descending: Bool = false}) {
+    {stable: bool = false, descending: bool = false}) {
   // Code using `stable` and `descending`.
 }
 ```

+ 1 - 1
docs/design/generics/goals.md

@@ -381,7 +381,7 @@ There are a few obstacles to supporting dynamic dispatch efficiently, which may
 limit the extent it is used automatically by implementations. For example, the
 following features would benefit substantially from guaranteed monomorphization:
 
--   Field packing in class layout. For example, packing a `Bool` into the lower
+-   Field packing in class layout. For example, packing a `bool` into the lower
     bits of a pointer, or packing bit-fields with generic widths.
 -   Allocating local variables in stack storage. Without monomorphization, we
     would need to perform dynamic memory allocation -- whether on the stack or

+ 6 - 6
docs/design/generics/overview.md

@@ -159,7 +159,7 @@ Example:
 ```
 interface Comparable {
   // `Less` is an associated method.
-  fn Less[me: Self](rhs: Self) -> Bool;
+  fn Less[me: Self](rhs: Self) -> bool;
 }
 ```
 
@@ -218,7 +218,7 @@ class Song {
 // the library defining `Song` or `Comparable`.
 external impl Song as Comparable {
   // Could use either `Self` or `Song` here.
-  fn Less[me: Self](rhs: Self) -> Bool { ... }
+  fn Less[me: Self](rhs: Self) -> bool { ... }
 }
 ```
 
@@ -350,7 +350,7 @@ Interfaces can require other interfaces be implemented:
 
 ```
 interface Equatable {
-  fn IsEqual[me: Self](rhs: Self) -> Bool;
+  fn IsEqual[me: Self](rhs: Self) -> bool;
 }
 
 // `Iterable` requires that `Equatable` is implemented.
@@ -386,7 +386,7 @@ methods in the implementation of the derived interface.
 class Key {
   // ...
   impl as Hashable {
-    fn IsEqual[me: Key](rhs: Key) -> Bool { ... }
+    fn IsEqual[me: Key](rhs: Key) -> bool { ... }
     fn Hash[me: Key]() -> u64 { ... }
   }
   // No need to separately implement `Equatable`.
@@ -535,7 +535,7 @@ interface Stack {
   let ElementType:! Movable;
   fn Push[addr me: Self*](value: ElementType);
   fn Pop[addr me: Self*]() -> ElementType;
-  fn IsEmpty[addr me: Self*]() -> Bool;
+  fn IsEmpty[addr me: Self*]() -> bool;
 }
 ```
 
@@ -561,7 +561,7 @@ those types to be different. An element in a hash map might have type
 
 ```
 interface Equatable(T:! Type) {
-  fn IsEqual[me: Self](compare_to: T) -> Bool;
+  fn IsEqual[me: Self](compare_to: T) -> bool;
 }
 ```
 

+ 1 - 1
docs/design/generics/terminology.md

@@ -192,7 +192,7 @@ overloads:
 
 ```
 fn F[template T:! Type](x: T*) -> T;
-fn F(x: Int) -> Bool;
+fn F(x: Int) -> bool;
 ```
 
 A generic function `G` can call `F` with a type like `T*` that can not possibly

+ 5 - 5
docs/design/name_lookup.md

@@ -76,12 +76,12 @@ the package scope for unqualified name lookup.
 
 The Carbon standard library is in the `Carbon` package. A very small subset of
 this standard library is provided implicitly in every file's scope. This is
-called the "prelude" package.
+called the "prelude".
 
-Names in the prelude package will be available without scoping names. For
-example, `Bool` will be the commonly used name in code, even though the
-underlying type may be `Carbon::Bool`. Also, no `import` will be necessary to
-use `Bool`.
+Names in the prelude will be available without a package qualifier. For example,
+the name `Type` can be directly used in code without a `Carbon.` qualifier, even
+though it belongs to the `Carbon` package, and no import is necessary to use the
+name `Type`.
 
 ## Open questions
 

+ 17 - 13
docs/design/primitive_types.md

@@ -37,33 +37,37 @@ modifying other types. They also have semantics that are defined from first
 principles rather than in terms of other operations. These will be made
 available through the [prelude package](README.md#name-lookup-for-common-types).
 
--   `Bool` - a boolean type with two possible values: `True` and `False`.
--   `Int` and `UInt` - signed and unsigned 64-bit integer types.
+-   `bool` - a boolean type with two possible values: `true` and `false`.
+-   Signed and unsigned 64-bit integer types:
     -   Standard sizes are available, both signed and unsigned, including `i8`,
-        `i16`, `i32`, `i64`, `i128`, and `i256`.
-    -   Overflow in either direction is an error.
--   `Float64` - a floating point type with semantics based on IEEE-754.
-    -   Standard sizes are available, including `f16`, `f32`, and `f128`.
+        `i16`, `i32`, `i64`, and `i128`, and `u8`, `u16`, `u32`, `u64`, and
+        `u128`.
+    -   Signed overflow in either direction is an error.
+-   Floating points type with semantics based on IEEE-754.
+    -   Standard sizes are available, including `f16`, `f32`, and `f64`.
     -   [`BFloat16`](primitive_types.md#bfloat16) is also provided.
 -   `String` - a byte sequence treated as containing UTF-8 encoded text.
     -   `StringView` - a read-only reference to a byte sequence treated as
         containing UTF-8 encoded text.
 
+The names `bool`, `true`, and `false` are keywords, and identifiers of the form
+`i[0-9]*`, `u[0-9]*`, and `f[0-9*]` are _type literals_, resulting in the
+corresponding type.
+
 ### Integers
 
 Integer types can be either signed or unsigned, much like in C++. Signed
 integers are represented using 2's complement and notionally modeled as
-unbounded natural numbers. Overflow in either direction is an error. That
-includes unsigned integers, differing from C++. The default size for both is
-64-bits: `Int` and `UInt`. Specific sizes are also available, for example:
-`Int8`, `Int16`, `Int32`, `Int128`, `UInt256`. Arbitrary powers of two above `8`
-are supported for both (although perhaps we'll want to avoid _huge_ values for
-implementation simplicity).
+unbounded natural numbers. Signed overflow in either direction is an error.
+Specific sizes are available, for example: `i8`, `u16`, `i32`, and `u128`.
+
+There is an upper bound on the size of an integer, most likely initially set to
+128 bits due to LLVM limitations.
 
 ### Floats
 
 Floating point types are based on the binary floating point formats provided by
-IEEE-754. `Float16`, `Float32`, `Float64` and `Float128` correspond exactly to
+IEEE-754. `f16`, `f32`, `f64` and, if available, `f128` correspond exactly to
 those sized IEEE-754 formats, and have the semantics defined by IEEE-754.
 
 ### BFloat16

+ 1 - 1
docs/project/principles/error_handling.md

@@ -32,7 +32,7 @@ way that enables the program to continue running.
 
 A Carbon function that needs to report recoverable failures should return a sum
 type whose alternatives represent the success case and failure cases, such as
-`Optional(T)`, `Result(T, Error)`, or `Bool`. The function's successful return
+`Optional(T)`, `Result(T, Error)`, or `bool`. The function's successful return
 value, and any metadata about the failure, should be embedded in the
 alternatives of the sum type, rather than reported by way of output parameters
 or other side channels. Carbon's design will prioritize making this form of

+ 1 - 1
docs/project/principles/library_apis_only.md

@@ -61,7 +61,7 @@ lookup as well.
 
 According to the resolutions of
 [#543](https://github.com/carbon-language/carbon-lang/issues/543) and
-[#750](https://github.com/carbon-language/carbon-lang/issues/543), Carbon will
+[#750](https://github.com/carbon-language/carbon-lang/issues/750), Carbon will
 have a substantial number of type keywords, such as `i32`, `f64`, and `bool`.
 However, these keywords will all be aliases for ordinary type names, such as
 `Carbon.Int(32)`, `Carbon.Float(64)`, and `Carbon.Bool`. Furthermore, all

+ 1 - 1
explorer/ast/expression.cpp

@@ -288,7 +288,7 @@ void Expression::PrintID(llvm::raw_ostream& out) const {
       out << (cast<BoolLiteral>(*this).value() ? "true" : "false");
       break;
     case ExpressionKind::BoolTypeLiteral:
-      out << "Bool";
+      out << "bool";
       break;
     case ExpressionKind::IntTypeLiteral:
       out << "i32";

+ 4 - 4
explorer/data/prelude.carbon

@@ -58,7 +58,7 @@ impl forall [U1:! Type, U2:! Type, U3:! Type,
 // ----------------------
 
 interface EqWith(U:! Type) {
-  fn Equal[me: Self](other: U) -> Bool;
+  fn Equal[me: Self](other: U) -> bool;
   // TODO: NotEqual with default impl
 }
 // TODO: constraint Eq { ... }
@@ -67,7 +67,7 @@ interface EqWith(U:! Type) {
 // TODO: Simplify this once we have variadics
 impl forall [T2:! Type, U2:! Type, T1:! EqWith(T2), U1:! EqWith(U2)]
     (T1, U1) as EqWith((T2, U2)) {
-  fn Equal[me: Self](other: (T2, U2)) -> Bool {
+  fn Equal[me: Self](other: (T2, U2)) -> bool {
     let (l1: T1, l2: U1) = me;
     let (r1: T2, r2: U2) = other;
     return l1 == r1 and l2 == r2;
@@ -75,13 +75,13 @@ impl forall [T2:! Type, U2:! Type, T1:! EqWith(T2), U1:! EqWith(U2)]
 }
 
 impl i32 as EqWith(Self) {
-  fn Equal[me: Self](other: Self) -> Bool {
+  fn Equal[me: Self](other: Self) -> bool {
     return __intrinsic_int_eq(me, other);
   }
 }
 
 impl String as EqWith(Self) {
-  fn Equal[me: Self](other: Self) -> Bool {
+  fn Equal[me: Self](other: Self) -> bool {
     return __intrinsic_str_eq(me, other);
   }
 }

+ 2 - 2
explorer/interpreter/interpreter.cpp

@@ -123,10 +123,10 @@ class Interpreter {
   // Instantiate a type by replacing all type variables that occur inside the
   // type by the current values of those variables.
   //
-  // For example, suppose T=i32 and U=Bool. Then
+  // For example, suppose T=i32 and U=bool. Then
   //     __Fn (Point(T)) -> Point(U)
   // becomes
-  //     __Fn (Point(i32)) -> Point(Bool)
+  //     __Fn (Point(i32)) -> Point(bool)
   auto InstantiateType(Nonnull<const Value*> type, SourceLocation source_loc)
       -> ErrorOr<Nonnull<const Value*>>;
 

+ 1 - 1
explorer/interpreter/value.cpp

@@ -340,7 +340,7 @@ void Value::Print(llvm::raw_ostream& out) const {
       out << "lval<" << cast<LValue>(*this).address() << ">";
       break;
     case Value::Kind::BoolType:
-      out << "Bool";
+      out << "bool";
       break;
     case Value::Kind::IntType:
       out << "i32";

+ 1 - 1
explorer/syntax/lexer.lpp

@@ -42,7 +42,7 @@ AS                   "as"
 AUTO                 "auto"
 AWAIT                "__await"
 BASE                 "base"
-BOOL                 "Bool"
+BOOL                 "bool"
 BREAK                "break"
 CARET                "^"
 CASE                 "case"

+ 1 - 1
explorer/testdata/basic_syntax/not_compare_precedence.carbon

@@ -10,7 +10,7 @@
 
 package ExplorerTest api;
 
-fn CompareBools(a: Bool, b: Bool) -> Bool {
+fn CompareBools(a: bool, b: bool) -> bool {
   // CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/basic_syntax/not_compare_precedence.carbon:[[@LINE+1]]: syntax error, unexpected EQUAL_EQUAL, expecting SEMICOLON
   return not a == b;
 }

+ 1 - 1
explorer/testdata/comparison/custom_equality.carbon

@@ -16,7 +16,7 @@ class MyType {
   var value: i32;
 
   impl as EqWith(Self) {
-    fn Equal[me: Self](other: Self) -> Bool {
+    fn Equal[me: Self](other: Self) -> bool {
       return me.value == other.value;
     }
   }

+ 1 - 1
explorer/testdata/comparison/fail_empty_struct.carbon

@@ -10,7 +10,7 @@ package ExplorerTest api;
 // TODO: This should work
 // CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/comparison/fail_empty_struct.carbon:[[@LINE+1]]: type error in call: '{}' is not implicitly convertible to 'Type'
 external impl {} as EqWith({}) {
-  fn Equal[me: Self](other: Self) -> Bool {
+  fn Equal[me: Self](other: Self) -> bool {
     return true;
   }
 }

+ 1 - 1
explorer/testdata/function/auto_return/fail_direct_recurse.carbon

@@ -12,7 +12,7 @@ package ExplorerTest api;
 
 // This is required to fail even though the Recurse() call's return value isn't
 // used.
-fn Recurse(x: i32, do_recurse: Bool) -> auto {
+fn Recurse(x: i32, do_recurse: bool) -> auto {
   if (do_recurse) {
     // CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/function/auto_return/fail_direct_recurse.carbon:[[@LINE+1]]: Function calls itself, but has a deduced return type
     Recurse(x, false);

+ 2 - 2
explorer/testdata/generic_class/fail_argument_deduction.carbon

@@ -21,9 +21,9 @@ fn FirstOfTwoPoints[T:! Type](a: Point(T), b: Point(T)) -> Point(T) {
 
 fn Main() -> i32 {
   var p: Point(i32) = {.x = 0, .y = 1};
-  var q: Point(Bool) = {.x = true, .y = false};
+  var q: Point(bool) = {.x = true, .y = false};
   // CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_class/fail_argument_deduction.carbon:[[@LINE+3]]: deduced multiple different values for T:! Type:
   // CHECK:   i32
-  // CHECK:   Bool
+  // CHECK:   bool
   return FirstOfTwoPoints(p, q).x;
 }

+ 2 - 2
explorer/testdata/generic_class/fail_point_equal.carbon

@@ -17,7 +17,7 @@ class Point(T:! Type) {
 
 fn Main() -> i32 {
   var p: Point(i32) = {.x = 0, .y = 0};
-  // CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_class/fail_point_equal.carbon:[[@LINE+1]]: type error in name binding: 'class Point(T = i32)' is not implicitly convertible to 'class Point(T = Bool)'
-  var q: Point(Bool) = p;
+  // CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_class/fail_point_equal.carbon:[[@LINE+1]]: type error in name binding: 'class Point(T = i32)' is not implicitly convertible to 'class Point(T = bool)'
+  var q: Point(bool) = p;
   return 0;
 }

+ 1 - 1
explorer/testdata/generic_function/apply.carbon

@@ -15,7 +15,7 @@ fn apply[T:! Type, U:! Type](f: __Fn (T) -> U, x: T) -> U {
   return f(x);
 }
 
-fn positive(x: Bool) -> i32 {
+fn positive(x: bool) -> i32 {
   if (x) {
     return 2;
   } else {

+ 1 - 1
explorer/testdata/generic_function/fail_type_deduction_mismatch.carbon

@@ -17,6 +17,6 @@ fn fst[T:! Type](x: T, y: T) -> T {
 fn Main() -> i32 {
   // CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_function/fail_type_deduction_mismatch.carbon:[[@LINE+3]]: deduced multiple different values for T:! Type:
   // CHECK:   i32
-  // CHECK:   Bool
+  // CHECK:   bool
   return fst(0, true);
 }

+ 1 - 1
explorer/testdata/global_variable/fail_init_type_mismatch.carbon

@@ -12,7 +12,7 @@ package ExplorerTest api;
 
 // Test type checking of global variable. Error expected.
 
-// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/global_variable/fail_init_type_mismatch.carbon:[[@LINE+1]]: type error in initializer of variable: 'Bool' is not implicitly convertible to 'i32'
+// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/global_variable/fail_init_type_mismatch.carbon:[[@LINE+1]]: type error in initializer of variable: 'bool' is not implicitly convertible to 'i32'
 var flag: i32 = true;
 
 fn Main() -> i32 {

+ 2 - 2
explorer/testdata/if_else/convert_condition.carbon

@@ -14,8 +14,8 @@ package ExplorerTest api;
 class LazyEq {
   var v1: i32;
   var v2: i32;
-  impl as ImplicitAs(Bool) {
-    fn Convert[me: Self]() -> Bool {
+  impl as ImplicitAs(bool) {
+    fn Convert[me: Self]() -> bool {
       return me.v1 == me.v2;
     }
   }

+ 2 - 2
explorer/testdata/if_expression/convert_condition.carbon

@@ -14,8 +14,8 @@ package ExplorerTest api;
 class LazyEq {
   var v1: i32;
   var v2: i32;
-  impl as ImplicitAs(Bool) {
-    fn Convert[me: Self]() -> Bool {
+  impl as ImplicitAs(bool) {
+    fn Convert[me: Self]() -> bool {
       return me.v1 == me.v2;
     }
   }

+ 1 - 1
explorer/testdata/if_expression/if_then_else.carbon

@@ -12,7 +12,7 @@
 package ExplorerTest api;
 
 fn Main() -> i32 {
-  var cond: if true then Bool else i32 = true;
+  var cond: if true then bool else i32 = true;
   if (if cond then true else false) {}
   while (if cond then false else true) {}
   return if if cond then true or false else false and true

+ 2 - 2
explorer/testdata/impl/fail_ambiguous_impl_generic.carbon

@@ -17,10 +17,10 @@ external impl forall [T:! Type] A(T) as B(i32) {}
 external impl forall [T:! Type] A(i32) as B(T) {}
 
 fn F[T:! B(i32)](x: T) {}
-fn G[T:! B(Bool)](x: T) {}
+fn G[T:! B(bool)](x: T) {}
 
 fn Main() -> i32 {
-  let a: A(Bool) = {};
+  let a: A(bool) = {};
   let b: A(i32) = {};
   F(a);
   G(b);

+ 1 - 1
explorer/testdata/impl/fail_param_interface_in_impl.carbon

@@ -21,7 +21,7 @@ fn Main() -> i32 {
   let n: i32 = 0;
   CheckSimilar(true, false);
   CheckSimilar(true, n);
-  // CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/impl/fail_param_interface_in_impl.carbon:[[@LINE+1]]: could not find implementation of interface Similar(T = i32) for Bool
+  // CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/impl/fail_param_interface_in_impl.carbon:[[@LINE+1]]: could not find implementation of interface Similar(T = i32) for bool
   CheckSimilar(n, false);
   return 0;
 }

+ 2 - 2
explorer/testdata/operators/shortcircuit_and.carbon

@@ -12,12 +12,12 @@
 package ExplorerTest api;
 
 var call_count: i32 = 0;
-fn ReturnFalse() -> Bool {
+fn ReturnFalse() -> bool {
   call_count = call_count + 1;
   return false;
 }
 
 fn Main() -> i32 {
-  var result: Bool = ReturnFalse() and ReturnFalse();
+  var result: bool = ReturnFalse() and ReturnFalse();
   return if not result then call_count else -1;
 }

+ 2 - 2
explorer/testdata/operators/shortcircuit_and_no_shortcircuit.carbon

@@ -12,12 +12,12 @@
 package ExplorerTest api;
 
 var call_count: i32 = 0;
-fn ReturnTrue() -> Bool {
+fn ReturnTrue() -> bool {
   call_count = call_count + 1;
   return true;
 }
 
 fn Main() -> i32 {
-  var result: Bool = ReturnTrue() and ReturnTrue();
+  var result: bool = ReturnTrue() and ReturnTrue();
   return if result then call_count else -1;
 }

+ 2 - 2
explorer/testdata/operators/shortcircuit_or.carbon

@@ -12,12 +12,12 @@
 package ExplorerTest api;
 
 var call_count: i32 = 0;
-fn ReturnTrue() -> Bool {
+fn ReturnTrue() -> bool {
   call_count = call_count + 1;
   return true;
 }
 
 fn Main() -> i32 {
-  var result: Bool = ReturnTrue() or ReturnTrue();
+  var result: bool = ReturnTrue() or ReturnTrue();
   return if result then call_count else -1;
 }

+ 2 - 2
explorer/testdata/operators/shortcircuit_or_no_shortcircuit.carbon

@@ -12,12 +12,12 @@
 package ExplorerTest api;
 
 var call_count: i32 = 0;
-fn ReturnFalse() -> Bool {
+fn ReturnFalse() -> bool {
   call_count = call_count + 1;
   return false;
 }
 
 fn Main() -> i32 {
-  var result: Bool = ReturnFalse() or ReturnFalse();
+  var result: bool = ReturnFalse() or ReturnFalse();
   return if not result then call_count else -1;
 }

+ 1 - 1
explorer/testdata/random/random.carbon

@@ -10,7 +10,7 @@
 // CHECK: result: 0
 
 package ExplorerTest api;
-fn test(para: i32)->Bool{
+fn test(para: i32)->bool{
   return true;
 }
 fn Main() -> i32 {

+ 2 - 2
explorer/testdata/returned_var/fail_returned_var_type_mismatch.carbon

@@ -11,8 +11,8 @@
 package ExplorerTest api;
 
 fn AddInt(a: i32, b: i32) -> i32 {
-  // CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/returned_var/fail_returned_var_type_mismatch.carbon:[[@LINE+1]]: type of returned var `Bool` does not match return type `i32`
-  returned var ret: Bool = true;
+  // CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/returned_var/fail_returned_var_type_mismatch.carbon:[[@LINE+1]]: type of returned var `bool` does not match return type `i32`
+  returned var ret: bool = true;
   return var;
 }
 

+ 1 - 1
explorer/testdata/struct/equality.carbon

@@ -13,7 +13,7 @@ package ExplorerTest api;
 
 // TODO: Implement this with some kind of reflection?
 external impl {.x: i32, .y: i32} as EqWith(Self) {
-  fn Equal[me: Self](other: Self) -> Bool {
+  fn Equal[me: Self](other: Self) -> bool {
     return me.x == other.x and me.y == other.y;
   }
 }

+ 1 - 1
explorer/testdata/struct/equality_false.carbon

@@ -13,7 +13,7 @@ package ExplorerTest api;
 
 // TODO: Implement this with some kind of reflection?
 external impl {.x: i32, .y: i32} as EqWith(Self) {
-  fn Equal[me: Self](other: Self) -> Bool {
+  fn Equal[me: Self](other: Self) -> bool {
     return me.x == other.x and me.y == other.y;
   }
 }

+ 1 - 1
explorer/testdata/struct/fail_equality_type.carbon

@@ -9,7 +9,7 @@ package ExplorerTest api;
 
 // TODO: Implement this with some kind of reflection?
 external impl {.x: i32, .y: i32} as EqWith(Self) {
-  fn Equal[me: Self](other: Self) -> Bool {
+  fn Equal[me: Self](other: Self) -> bool {
     return me.x == other.x and me.y == other.y;
   }
 }

+ 2 - 2
explorer/testdata/while/convert_condition.carbon

@@ -14,8 +14,8 @@ package ExplorerTest api;
 class LazyNe {
   var v1: i32;
   var v2: i32;
-  impl as ImplicitAs(Bool) {
-    fn Convert[me: Self]() -> Bool {
+  impl as ImplicitAs(bool) {
+    fn Convert[me: Self]() -> bool {
       return not (me.v1 == me.v2);
     }
   }

+ 1 - 1
third_party/examples/re2/re2.carbon

@@ -302,7 +302,7 @@ class RE2 {
   impl as Destroyable;
 
   // Returns whether RE2 was created properly.
-  fn ok[me: Self]() -> Bool { return me.error_code() == ErrorCode.NoError; }
+  fn ok[me: Self]() -> bool { return me.error_code() == ErrorCode.NoError; }
 
   // The string specification for this RE2.  E.g.
   //   RE2 re("ab*c?d+");