-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move TypeSignature into field of Function #11364
Conversation
93a0952
to
734f286
Compare
lib/rust/parser/src/syntax/tree.rs
Outdated
pub name: Tree<'s>, | ||
/// The `:` token. | ||
pub operator: token::TypeAnnotationOperator<'s>, | ||
/// The variable's type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: are functions considered variables?
lib/rust/parser/src/syntax/tree.rs
Outdated
@@ -268,13 +270,7 @@ macro_rules! with_ast_definition { ($f:ident ($($args:tt)*)) => { $f! { $($args) | |||
}, | |||
/// Statement declaring the type of a variable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: another case when we call a function variable
lib/rust/parser/src/syntax/tree.rs
Outdated
/// The variable's type. | ||
#[reflect(rename = "type")] | ||
pub type_: Tree<'s>, | ||
pub signature: FunctionTypeSignature<'s>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I’m not sure why it is called FunctionTypeSignature
. Shouldn’t it be TypeSignature
, as it can be used with variables as well?
lib/rust/parser/src/syntax/tree.rs
Outdated
@@ -874,6 +906,8 @@ impl From<SyntaxError> for Cow<'static, str> { | |||
PatternUnexpectedDot => "In a pattern, the dot operator can only be used in a qualified name", | |||
CaseOfInvalidCase => "Invalid case expression.", | |||
DocumentationUnexpectedNonInitial => "Unexpected documentation at end of line", | |||
UnexpectedTypeSignatureDeclaration => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kind of error is not emitted anywhere; is it useful?
ca8afe5
to
65a5934
Compare
Pull Request Description
Move type-signature lines into
Function
field. Also implements #11293.Stacked on #11346.
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
or the Snowflake database integration, a run of the Extra Tests has been scheduled.