mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
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:
@@ -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
@@ -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
@@ -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
@@ -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 {}; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user