-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #7669: Implement extended with
syntax for extension methods.
#7670
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
Conversation
- Break out optional `with` from TemplateBody production - Disallow `new with { ...}`.
We don't actually solve this one. `given` still applies to all parameters in a clause.
Don't allow extension methods to have type parameters if collective type parameters were already given. The reason to disallow is that we don't support multiple consecutive type argument sections yet. And merging two type parameter sections into one would break a future extension where we do allow multiple consecutive type argument sections.
So far we allowed `given A, B with ... ` but not `given A with B with ... `
Implement `extended with` syntax for extension methods.
355cfd7
to
4f62d5f
Compare
4f62d5f
to
f41f4b8
Compare
constrApps(commaOK = true, templateCanFollow = true) | ||
else if in.token == SUBTYPE then | ||
if !mods.is(Inline) then | ||
syntaxError("`<:' is only allowed for given with `inline' modifier") |
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.
Use `<:`
instead of `<:'
(same with inline) ? Both conventions seem to be used in the parser, but markdown-like syntax is probably more user-friendly.
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.
Let's discuss which one to use and then standardize. I'll open an issue.
Based on #7657