mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 08:31:04 +01:00
Switch static_type to return Expression& (#887)
This commit is contained in:
@@ -54,7 +54,7 @@ class Expression {
|
||||
auto source_loc() const -> SourceLocation { return source_loc_; }
|
||||
|
||||
// The static type of this expression. Cannot be called before typechecking.
|
||||
auto static_type() const -> Nonnull<const Value*> { return *static_type_; }
|
||||
auto static_type() const -> const Value& { return **static_type_; }
|
||||
|
||||
// Sets the static type of this expression. Can only be called once, during
|
||||
// typechecking.
|
||||
|
||||
@@ -61,7 +61,7 @@ class FunctionDefinition {
|
||||
auto body() -> std::optional<Nonnull<Statement*>> { return body_; }
|
||||
|
||||
// The static type of this function. Cannot be called before typechecking.
|
||||
auto static_type() const -> Nonnull<const Value*> { return *static_type_; }
|
||||
auto static_type() const -> const Value& { return **static_type_; }
|
||||
|
||||
// Sets the static type of this expression. Can only be called once, during
|
||||
// typechecking.
|
||||
|
||||
@@ -49,7 +49,7 @@ class Pattern {
|
||||
auto source_loc() const -> SourceLocation { return source_loc_; }
|
||||
|
||||
// The static type of this pattern. Cannot be called before typechecking.
|
||||
auto static_type() const -> Nonnull<const Value*> { return *static_type_; }
|
||||
auto static_type() const -> const Value& { return **static_type_; }
|
||||
|
||||
// Sets the static type of this expression. Can only be called once, during
|
||||
// typechecking.
|
||||
|
||||
Reference in New Issue
Block a user