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

ast: remove type inference in case of routine with explicit type and => #2037

Merged
merged 3 commits into from Oct 4, 2023

Conversation

fridis
Copy link
Member

@fridis fridis commented Sep 29, 2023

For a routine declaration of the form

  r() t => v

The result type was ignored and inferred from v. The reason was that the implementation was set to RoutineDef, while it should be Routine in this case.

This patch makes sure that if a type is present in a routine declaration, the kind will be Routine, not RoutineDef.

…`=>`

For a routine declaration of the form

  r() t => v

The result type was ignored and inferred from `v`.  The reason was that the Impl
was set to RoutineDef, while it should be Routine in this caes.

This patch makes sure that if a type is present in a routine declaration, the
kind will be `Routine`, not `RoutineDef`.
…ue` as type

Routines like

  r() ref => v
  f ref := v

should not be considered to have a type declaration.
The error message used the show an empty result type.

Extended regression test 350.
@fridis fridis merged commit 66bbfcd into main Oct 4, 2023
5 checks passed
@fridis fridis deleted the fix_routine_with_result_and_arrow branch October 4, 2023 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants