-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ConstraintSolver] Avoid unnecessarily increasing score when matching function types #12593
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// RUN: %target-swift-frontend -emit-sil -verify %s | %FileCheck %s | ||
|
||
func foo<T>(_ a: T) -> Int { | ||
return 0 | ||
} | ||
|
||
func foo(_ a: (Int) -> (Int)) -> Int { | ||
return 42 | ||
} | ||
|
||
// CHECK: function_ref @_T012rdar351421213fooS3icF : $@convention(thin) (@owned @noescape @callee_owned (Int) -> Int) -> Int | ||
let _ = foo({ (a: Int) -> Int in a + 1 }) | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// RUN: %scale-test --invert-result --begin 2 --end 7 --step 1 --select incrementScopeCounter %s | ||
// RUN: %scale-test --begin 2 --end 10 --step 1 --select incrementScopeCounter %s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a bit surprising that this would have a real effect on whether this is fast or slow. Are you confident this is a real improvement, or was this perhaps not really slow before (e.g. it was slow over that range but wasn't truly exponential?). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a real improvement because this triggers logic in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. |
||
// REQUIRES: OS=macosx | ||
// REQUIRES: asserts | ||
|
||
|
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.
@rudkx Does this look better?