mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-03 22:02:51 +01:00
Add typechecking of type declarations (#984)
Also explicitly model the types of expressions whose values are class or choice types, and make those be the static_type of the type declaration. This ensures that the static_type of a NamedEntity consistently corresponds to the static type of an IdentifierExpression using that name.
This commit is contained in:
@@ -392,6 +392,8 @@ auto Interpreter::Convert(Nonnull<const Value*> value,
|
||||
case Value::Kind::ContinuationValue:
|
||||
case Value::Kind::StringType:
|
||||
case Value::Kind::StringValue:
|
||||
case Value::Kind::TypeOfClassType:
|
||||
case Value::Kind::TypeOfChoiceType:
|
||||
// TODO: add `CHECK(TypeEqual(type, value->dynamic_type()))`, once we
|
||||
// have Value::dynamic_type.
|
||||
return value;
|
||||
|
||||
Reference in New Issue
Block a user