Skip to content
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

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

kazcw
Copy link
Contributor

@kazcw kazcw commented Oct 18, 2024

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:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

@kazcw kazcw added the CI: No changelog needed Do not require a changelog entry for this PR. label Oct 18, 2024
@kazcw kazcw self-assigned this Oct 18, 2024
@kazcw kazcw linked an issue Oct 18, 2024 that may be closed by this pull request
@kazcw kazcw force-pushed the wip/kw/function-signature-field branch from 93a0952 to 734f286 Compare October 18, 2024 23:48
@kazcw kazcw marked this pull request as ready for review October 19, 2024 01:51
pub name: Tree<'s>,
/// The `:` token.
pub operator: token::TypeAnnotationOperator<'s>,
/// The variable's type.
Copy link
Contributor

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?

@@ -268,13 +270,7 @@ macro_rules! with_ast_definition { ($f:ident ($($args:tt)*)) => { $f! { $($args)
},
/// Statement declaring the type of a variable.
Copy link
Contributor

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

/// The variable's type.
#[reflect(rename = "type")]
pub type_: Tree<'s>,
pub signature: FunctionTypeSignature<'s>,
Copy link
Contributor

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?

@@ -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 =>
Copy link
Contributor

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?

@kazcw kazcw force-pushed the wip/kw/function-signature-field branch from ca8afe5 to 65a5934 Compare October 22, 2024 16:33
@kazcw kazcw added the CI: Ready to merge This PR is eligible for automatic merge label Oct 22, 2024
@mergify mergify bot merged commit 4e4a1e1 into develop Oct 22, 2024
42 checks passed
@mergify mergify bot deleted the wip/kw/function-signature-field branch October 22, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parse tail of block as expression
4 participants