Rename Type -> type, per #2360. (#2507)

Also make minor updates to the skeletal design in
docs/design/name_lookup.md following #2113, as there are no longer any prelude names that are made available to unqualified name lookup by default.

Add `type` to the keyword list in
docs/design/lexical_conventions/words.md, following #2360.
This commit is contained in:
Richard Smith
2023-01-04 14:22:30 -08:00
committed by GitHub
parent a1ad39fa29
commit 4daaa4866f
193 changed files with 572 additions and 570 deletions
@@ -9,7 +9,7 @@
package ExplorerTest api;
fn Id(t: Type) -> auto { return t; }
fn Id(t: type) -> auto { return t; }
// Test non-trivial type expression in parameter type.
@@ -9,7 +9,7 @@
package ExplorerTest api;
fn Id(t: Type) -> auto { return t; }
fn Id(t: type) -> auto { return t; }
// Test non-trivial type expression in return type.
+1 -1
View File
@@ -9,7 +9,7 @@
package ExplorerTest api;
fn Id(t: Type) -> auto { return t; }
fn Id(t: type) -> auto { return t; }
// Test non-trivial type expression in variable declaration statement.
+1 -1
View File
@@ -9,7 +9,7 @@
package ExplorerTest api;
// 42 cannot be used as the type of a parameter.
// CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/function/fail_parameter_type.carbon:[[@LINE+1]]: type error in type of name binding: 'i32' is not implicitly convertible to 'Type'
// CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/function/fail_parameter_type.carbon:[[@LINE+1]]: type error in type of name binding: 'i32' is not implicitly convertible to 'type'
fn f(x: 42) -> i32 {
return x - 1;
}
@@ -8,7 +8,7 @@
package ExplorerTest api;
fn T() -> Type {
fn T() -> type {
// CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/function/fail_recurse_before_typecheck.carbon:[[@LINE+1]]: attempt to call function `T` that has not been fully type-checked
var v: T() = 0;
return i32;
@@ -8,7 +8,7 @@
package EmptyIdentifier impl;
fn apply[T:! Type, U:! Type](f: T, EmptyIdentifier: U) {
fn apply[T:! type, U:! type](f: T, EmptyIdentifier: U) {
// CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/function/fail_return_call_has_invalid_body.carbon:[[@LINE+1]]: only arrays and tuples can be indexed, found bool
match (true[true]) {}
}
+1 -1
View File
@@ -13,7 +13,7 @@ fn test() -> i32 {
}
fn Main() -> i32 {
// CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/function/fail_var_type_is_call.carbon:[[@LINE+1]]: type error in type of name binding: 'i32' is not implicitly convertible to 'Type'
// CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/function/fail_var_type_is_call.carbon:[[@LINE+1]]: type error in type of name binding: 'i32' is not implicitly convertible to 'type'
var x: test() = 1;
return 0;
}
@@ -10,8 +10,8 @@
package ExplorerTest api;
class TypeLike {
impl as ImplicitAs(Type) {
fn Convert[self: Self]() -> Type { return i32; }
impl as ImplicitAs(type) {
fn Convert[self: Self]() -> type { return i32; }
}
fn Make() -> Self { return {}; }
}