mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-29 15:15:14 +01:00
We don't seem to have any need for `TypeOf*Type` types, and having them introduces the temptation to use them during type-checking, which would lead to types having different behavior when their type-of-type is `Type` versus when it's a more precise type. Remove these types for now. If we later decide that we want each type literal to have a unique type, as we do for value literals, we can introduce a single value kind for that rather than one for each kind of type. No changes to `TypeOfMemberName`, `TypeOfParameterizedEntityName`, and `TypeOfMixinPseudoType`, which are placeholders, not real types.
20 lines
538 B
Plaintext
20 lines
538 B
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// AUTOUPDATE
|
|
// RUN: %{explorer-run}
|
|
// RUN: %{explorer-run-trace}
|
|
// CHECK:STDOUT: result: 0
|
|
|
|
package ExplorerTest api;
|
|
|
|
class A { fn F[me: Self]() -> i32 { return 0; } }
|
|
|
|
fn Main() -> i32 {
|
|
// {} is a bit strange: its type is {}. Make sure we can properly convert a
|
|
// value of type {} to class type.
|
|
var a: A = {};
|
|
return a.F();
|
|
}
|