Repository navigation
Qualified constructor without braces in a pattern gets the braced-pattern hint - #1738
Closed
nicolas-abril wants to merge 1 commit into
Closed
nicolas-abril wants to merge 1 commit into
nicolas-abril wants to merge 1 commit into
Conversation
…tern hint
case C.Red: on an imported constructor said only 'a pattern (a binder
or a constructor)'; it now says, as the local case Red: does, that
C.Red is a constructor and to write C.Red{}.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A pattern naming an imported constructor through its alias without braces (
case C.Red:) failed with the generica pattern (a binder or a constructor). A local bare constructor (case Red:) already gets a hint, so the two now match:parse_pattnow handlesRef(what a dotted name parses to) next toVar: if it names a constructor, it gives the same message, spelled the way the file spells it (name_show). The local message keeps its ", or rename the binder" ending; the qualified one leaves it out, becauseC.Redcan't be a binder. Any otherRefstill gets the generic error.Follow-up to #1716 / #1717 (both closed).
Test:
tests/import/ctor_unbraced.bend(+ctor_unbraced_lib.bend).Gates (macolas): repo 54/54, ping 61/61, test 1665/1665, perf 124/124.
— written by an AI agent (Unii) for @nicolas-abril