-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #3004 and simplify exhaustivity check #3011
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
Review @AleksanderBG ? |
@@ -641,6 +628,15 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic { | |||
|
|||
/** Display spaces */ | |||
def show(s: Space): String = { | |||
def params(tp: Type): List[Type] = { |
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.
This function seems to be mostly doing unnecessary work - the actual types returned are never used, and the only thing that matters is the length of the returned list.
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.
To clarify, I've checked that the length of .firstParamTypes
does not actually change - all tests still pass if this function returns ktor.firstParamTypes
.
@liufengyun - I've tried to review what I can, and apart from that single nitpick everything looks good to me. I'm a bit out of my depth when it comes to verifying that the new implementation of |
tests/patmat/t9232.check
Outdated
@@ -1 +1,3 @@ | |||
13: Pattern Match Exhaustivity: Node2(), Node1(Foo(_)) | |||
13: Pattern Match Exhaustivity: Node2() | |||
17: Pattern Match Exhaustivity: Node2(), Node1(Foo(Nil)), Node1(Foo(List(_, _*))) |
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.
Should List(_, _*)
be List(_, _: _*)
?
Thanks @AleksanderBG . The |
Would be nice to add a comment pointing to the corresponding code in the pattern matcher. Even nicer if we could share some code but I don't know if that's possible here :). |
test performance please |
performance test scheduled: 1 jobs in total. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/3011 to see the changes. |
Fix #3004 and simplify exhaustivity check