-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Fix and improve Unimplemented
compile errors
#5847
Merged
Merged
Conversation
This file contains 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
Benchmark for a1919c0Click to view benchmark
|
Benchmark for eba608cClick to view benchmark
|
IGI-111
previously approved these changes
Apr 12, 2024
Benchmark for 07cdccaClick to view benchmark
|
jjcnn
previously approved these changes
Apr 12, 2024
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.
A few nits, but otherwise LGTM.
sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs
Outdated
Show resolved
Hide resolved
Benchmark for dc719a8Click to view benchmark
|
xunilrj
previously approved these changes
Apr 13, 2024
Benchmark for ac1ea19Click to view benchmark
|
IGI-111
approved these changes
Apr 15, 2024
xunilrj
approved these changes
Apr 15, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
compiler: frontend
Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
compiler: ui
Mostly compiler messages
compiler
General compiler. Should eventually become more specific as the issue is triaged
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.
Description
This PR:
mut
is not implemented in pattern matching. Support forref
,mut
, andref mut
in pattern matching will be done later as a part of support for references in pattern matching.Unimplemented
Error not emitted when matching on aliases #5846 by checking if aliased type can be matched.Diagnostic
for theUnimplemented
error and removes theUnimplementedWithHelp
error.Unimplemented
error was used for both which emitted misleading errors inmatch
expressions, using module paths in place of expressions, and trait implementations.Closes #5803, #5846.
Demo
Before:
![Self type of an impl block is not valid - Before](https://private-user-images.githubusercontent.com/4142833/321946111-7375b30a-70b8-4e37-b15d-7290d62d2ac1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1OTg1MzEsIm5iZiI6MTcyMDU5ODIzMSwicGF0aCI6Ii80MTQyODMzLzMyMTk0NjExMS03Mzc1YjMwYS03MGI4LTRlMzctYjE1ZC03MjkwZDYyZDJhYzEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTBUMDc1NzExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzhhODU5ODZkMDc0Y2I5Yzc4ZjVhMjBiOGVhMjdlODZkMThiYjQ3YTk2NjZiODZmZTBlMWU0NGRmNTJmMzBmMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.GqRqynOKgYODiK069mADgtTvwzPzoPR8MahjMbia1CQ)
After:
![Self type of an impl block is not valid - After](https://private-user-images.githubusercontent.com/4142833/321946105-5c12a4cb-2a68-4583-b204-5595c9e4cef0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1OTg1MzEsIm5iZiI6MTcyMDU5ODIzMSwicGF0aCI6Ii80MTQyODMzLzMyMTk0NjEwNS01YzEyYTRjYi0yYTY4LTQ1ODMtYjIwNC01NTk1YzllNGNlZjAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTBUMDc1NzExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTljYjg0MTRiMDI5YTJmM2VjZGRlODAxYzFiYjM2OGE5ZjgyZTI0N2ZiMGM1Y2E1MDc2MzEzZTYzZDg2OWEzZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.aatSwtRnY69puUE500xb9_YI5QTVN3mixKFyHfKfHxI)
Before:
![Module path is not an expression - Before](https://private-user-images.githubusercontent.com/4142833/322304758-e883a24b-11b2-466d-8cde-e92275620b20.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1OTg1MzEsIm5iZiI6MTcyMDU5ODIzMSwicGF0aCI6Ii80MTQyODMzLzMyMjMwNDc1OC1lODgzYTI0Yi0xMWIyLTQ2NmQtOGNkZS1lOTIyNzU2MjBiMjAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTBUMDc1NzExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MmEwMTNhZTQ5MmFlZTVhOGE5YmUzNTdhYTZiMzc3OTUwY2Y1MmVkNmM2YTI1MjhjNTE2YjdkYjYwZTBkMGNiZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.0MA5Ym2byZaSkhMd8JbhBfqNeYT5eLsJSIfYShGOVBI)
After:
![Module path is not an expression - After](https://private-user-images.githubusercontent.com/4142833/322304731-acdf5349-daed-4e04-bd11-5a58c197a624.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1OTg1MzEsIm5iZiI6MTcyMDU5ODIzMSwicGF0aCI6Ii80MTQyODMzLzMyMjMwNDczMS1hY2RmNTM0OS1kYWVkLTRlMDQtYmQxMS01YTU4YzE5N2E2MjQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTBUMDc1NzExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MWM5NWZkN2MzYmNjNTRiMzAyNDY3NGNjOGNhOWQ4MzkxODAzMzlhNGNhYjUyYjdkMWViMjkwM2M1ZGIyNTExZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.mXFPK3Aqd-6lI6NoLSaoafNBsaAmPMuznJo-X37OyAA)
Diagnostic for
![Matching on this type is currently not implemented - After](https://private-user-images.githubusercontent.com/4142833/321946113-db15b604-5aa9-4cf9-a608-4804a202ab4c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA1OTg1MzEsIm5iZiI6MTcyMDU5ODIzMSwicGF0aCI6Ii80MTQyODMzLzMyMTk0NjExMy1kYjE1YjYwNC01YWE5LTRjZjktYTYwOC00ODA0YTIwMmFiNGMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTBUMDc1NzExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YmFiNGQ3NGY5NTQ3MjM1NDAwMTcyNGZiNzQ1MmUxNzc3YTQ0ZjhlYjU1N2I5OWU4OWE3ZDcwMTEzZmRhZDJjZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.TfEUGI7ffCuukD1a3mG6aq0l5vGeR7R13Goe6nMsXIU)
Unimplemented
error:Checklist
Breaking*
orNew Feature
labels where relevant.