Skip to content

[Sema] Fix Issue #63291 by aligning error messages for failure to infer generic parameter and opaque result type #63567

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

Merged
merged 1 commit into from
Feb 13, 2023

Conversation

Rajveer100
Copy link
Contributor

Aligned the errors messages caused by failure to inferring generic parameter and opaque result type, by changing the messages appropriately in the include/swift/AST/DiagnosticsSema.def file, as well as the tests file test/type/opaque.swift and test/type/opaque_return_named.swift.

Resolves #63291.

@Rajveer100
Copy link
Contributor Author

@AnthonyLatsis This is the new pull request.

@ahoppen
Copy link
Member

ahoppen commented Feb 10, 2023

Hey @Rajveer100,

Thanks for the pull request. @AnthonyLatsis’s comment from your previous pull request are still valid though. I would suggest that

  • You squash your three commits into one
  • Edit your commit message to have a [Sema] prefix
  • Force push the changes to your branch

For each of these bullet points, there should be plenty of tutorial on the internet of how to do them either on the command line or in whichever Git GUI you are using.

@Rajveer100
Copy link
Contributor Author

Sure! I was just gonna do that...These mistakes are increasing my knowledge a ton! Thanks!

@ahoppen
Copy link
Member

ahoppen commented Feb 10, 2023

OK, I just thought that you opened a new pull request because you didn’t know that you could force push, so I thought I’d mention some tips.

@Rajveer100 Rajveer100 force-pushed the branch-for-issue-63291 branch from c146cbd to f74ddd1 Compare February 10, 2023 11:09
@Rajveer100
Copy link
Contributor Author

Made the changes!

@Rajveer100 Rajveer100 changed the title Fix Issue #63291 by aligning error messages for failure to infer generic parameter and opaque result type [Sema] Fix Issue #63291 by aligning error messages for failure to infer generic parameter and opaque result type Feb 10, 2023
@AnthonyLatsis
Copy link
Collaborator

There is still a redundant merge commit.

@ahoppen
Copy link
Member

ahoppen commented Feb 10, 2023

It’s not really required but since we are already doing a Git lesson: You can get rid of the merge commit in your git history by rebasing on top of main instead of merging main into your branch. That way this PR will only contain a single commit.

Just pull recent main, switch to your branch and run git rebase main. If the merge commit is still in your git history, you can delete it using git rebase as well.

@AnthonyLatsis
Copy link
Collaborator

AnthonyLatsis commented Feb 10, 2023

Pulling is probably not necessary in this case, but if you choose to, make sure to use update-checkout.

@Rajveer100 Rajveer100 force-pushed the branch-for-issue-63291 branch from c893fdd to 28dba82 Compare February 10, 2023 11:39
@Rajveer100
Copy link
Contributor Author

Done!

@AnthonyLatsis
Copy link
Collaborator

AnthonyLatsis commented Feb 10, 2023

One more suggestion. Consider placing the bug link in the commit message body rather than the title. For example:

[Sema] Align error messages ...

Fixes <link>.

To edit the commit message: git commit --amend + force-push.

@Rajveer100 Rajveer100 force-pushed the branch-for-issue-63291 branch from 28dba82 to a4597a9 Compare February 10, 2023 12:14
@Rajveer100
Copy link
Contributor Author

Amended!

@AnthonyLatsis
Copy link
Collaborator

@swift-ci please smoke test macOS

@Rajveer100
Copy link
Contributor Author

Rajveer100 commented Feb 10, 2023

Smoke Test failed, what could be the cause?

@xedin xedin requested a review from AnthonyLatsis February 11, 2023 00:09
@AnthonyLatsis
Copy link
Collaborator

AnthonyLatsis commented Feb 11, 2023

The failure is due to network flakiness; not your fault. Can you get rid of the merge commit before we re-trigger the tests?

@Rajveer100 Rajveer100 force-pushed the branch-for-issue-63291 branch 2 times, most recently from 637355b to 33bf9d2 Compare February 11, 2023 06:12
@Rajveer100
Copy link
Contributor Author

I have done it, you may re-trigger the smoke test! @AnthonyLatsis

@ahoppen
Copy link
Member

ahoppen commented Feb 11, 2023

@swift-ci Please smoke test

@Rajveer100
Copy link
Contributor Author

Rajveer100 commented Feb 11, 2023

Hey Alex! @ahoppen What would be some next potential projects I can contribute to and what would be the steps for swift-evolution proposal (and maybe you could guide me for GSoC 2023!) as I came across certain issues like implementing C++ libraries for interoperability.

@Rajveer100 Rajveer100 force-pushed the branch-for-issue-63291 branch from 6448393 to 33bf9d2 Compare February 11, 2023 08:03
@ahoppen
Copy link
Member

ahoppen commented Feb 11, 2023

@swift-ci Please smoke test

@ahoppen
Copy link
Member

ahoppen commented Feb 11, 2023

It really depends what you want to work on.

Regarding the compiler, I don’t know of any specific issues in the compiler codebase that would be good to get started, apart from the list of issues marked as “good first issue” that you probably already know about: https://github.com/apple/swift/labels/good%20first%20issue.

Keep in mind there are other projects like swift-syntax or sourcekit-lsp in the Swift ecosystem that are mostly implemented in Swift and which also have issues that would be good starting points. Especially for those projects that have fewer issues, it might also be worth scanning through issues that aren’t marked as “good first issue” as we sometimes forget to add the label.

Regarding swift-evolution: You can participate in review threads on forums.swift.org. I would advise against trying to create an evolution proposal unless you’ve got a specific language change in mind that you want to push.

As for GSoC, in the past years we have always proposed ideas on swift.org and announced them in the forums but you can also propose your own project ideas if you have any. If you do, I would suggest you create forum post that describes your project idea.

@Rajveer100
Copy link
Contributor Author

Thanks! I will look into the other repos as well, and regarding swift-evolution I actually meant to solve the issues having that tag, and not mentioning my own ideas as of now, so I was clueless on how to even make a proposal for the same. The same goes for GSoC, I don't know how to start with such things, felt little clueless, hence asked. Maybe as I contribute with time, I will get some idea.

@ahoppen
Copy link
Member

ahoppen commented Feb 11, 2023

I would suggest that you start with smaller issues to get familiar with the code base, the process etc. and not start with implementing entire language features – that’s what I did as well when I got started contributing to Swift as well.

Regarding GSoC, I would keep an eye out in the forums because that would be the place we make any announcements regarding GSoC 2023.

@Rajveer100
Copy link
Contributor Author

Rajveer100 commented Feb 11, 2023

Cool! I too actually thought the same, that with time, I can contribute and gain experience and gradually understand everything by usual search, mistakes and grinding, instead of asking questions to do this and that, but had to do a little journalism approach (I had even asked Anthony if I bothered him a lot!) at least in the beginning to get a push start and setup my arena!

@Rajveer100
Copy link
Contributor Author

Rajveer100 commented Feb 11, 2023

Why are the tests failing by the way? (I mean the first time Anthony mentioned due to network issue.)

@ahoppen
Copy link
Member

ahoppen commented Feb 11, 2023

The Linux failure seems to be some kind of CI hiccup. It looks like the run was aborted by the force push and didn’t re-trigger when I requested it.

@swift-ci Please smoke test Linux

@Rajveer100
Copy link
Contributor Author

macOS test has passed, others have failed.

@AnthonyLatsis
Copy link
Collaborator

@swift-ci please smoke test Linux

@Rajveer100
Copy link
Contributor Author

Rajveer100 commented Feb 11, 2023

Nice! So only windows test remains.

@AnthonyLatsis
Copy link
Collaborator

We can skip the Windows build, it cannot possibly be related to a change like this if the other jobs passed.

@ahoppen ahoppen merged commit e7d2dfa into swiftlang:main Feb 13, 2023
@Rajveer100 Rajveer100 deleted the branch-for-issue-63291 branch February 13, 2023 12:11
@AnthonyLatsis AnthonyLatsis added improvement compiler The Swift compiler itself diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis generics Feature: generic declarations and types opaque types Feature → types: opaque types labels Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler itself diagnostics QoI Bug: Diagnostics Quality of Implementation generics Feature: generic declarations and types improvement opaque types Feature → types: opaque types type checker Area → compiler: Semantic analysis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error messages for failure to infer generic parameter and opaque result type should be aligned
3 participants