Skip to content

Type annotation for patterns#1366

Open
martin-ilgner wants to merge 4 commits intomainfrom
feature/pattern-type-annot
Open

Type annotation for patterns#1366
martin-ilgner wants to merge 4 commits intomainfrom
feature/pattern-type-annot

Conversation

@martin-ilgner
Copy link
Copy Markdown
Contributor

Tries to resolve the issues mentioned in #1308

@phischu
Copy link
Copy Markdown
Collaborator

phischu commented Apr 14, 2026

Great! Please add a test file examples/pos/pattern_annotations.effekt with the examples from the linked issue.

@martin-ilgner martin-ilgner self-assigned this Apr 15, 2026
@martin-ilgner
Copy link
Copy Markdown
Contributor Author

martin-ilgner commented Apr 17, 2026

Done. But there is a problem:

str match {
  case "hello" => "world"
  case s: String => s
  case _ => "bye"
}

is wrongly parsed. It takes the match arrow as part of a function type. But still fails with Expected => but got keyword case

@martin-ilgner martin-ilgner marked this pull request as ready for review April 26, 2026 08:27
@martin-ilgner
Copy link
Copy Markdown
Contributor Author

martin-ilgner commented Apr 26, 2026

Should I also try to understand the Typer and use the parsed TypeAnnotation?

Edit: Too complicated

@martin-ilgner martin-ilgner requested a review from phischu April 26, 2026 08:39
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.

2 participants