You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe fooParam should have type of (Int,Int) -> () and fooTuple of type ((Int,Int)) -> (), but it seems like they have the same type:
funcfooParam(_x: Int, _y: Int){}
funcfooTuple(_x: (Int, Int)) {}
print("type of fooParam is", type(of:fooParam))
// result: type of fooParam is (Int, Int) -> ()print("type of fooTuple is", type(of:fooTuple))
// result: type of fooTuple is (Int, Int) -> ()print("type of fooTuple as (_:(Int,Int))->Void is", type(of: fooTupleas (_:(Int,Int))->()))
// result: type of fooTuple as (_:(Int,Int))->() is (Int, Int) -> ()print("type of fooParam == type of fooTuple ?", type(of: fooParam) == type(of: fooTuple))
// result: true//--- closure ---varclosureParam = { (x: Int, y: Int) in }
varclosureTuple = { (x: (Int, Int)) in }
print("type of closureParam is", type(of:closureParam))
// result: type of closureParam is (Int, Int) -> ()print("type of closureTuple is", type(of:closureTuple))
// result: type of closureTuple is (Int, Int) -> ()
The text was updated successfully, but these errors were encountered:
funcfooTuple(_x: (Int, Int)) {}
lett = type(of: fooTuple)
we maintain the fact that it’s a function taking a tuple through the AST passes, but it looks like the SIL metatype instruction treats it like a function taking two arguments.
I suspect this is simply a result of canonicalizing the type when generating SIL.
Yeah, the current implementation of SE-0110 does not fully address this. Runtime types are still canonicalized. We need to represent FunctionType as having an argument list and a result, instead of a single input and a result, so that single-argument function types canonicalize properly.
Environment
swift-4.0-DEVELOPMENT-SNAPSHOT-2017-06-01-a-osx
Additional Detail from JIRA
md5: e265814eeaa6d3f294a7315eed219f29
is blocked by:
is duplicated by:
Issue Description:
Mark Lacey <mark.lacey@apple.com> asked to create this issue.
I believe fooParam should have type of (Int,Int) -> () and fooTuple of type ((Int,Int)) -> (), but it seems like they have the same type:
The text was updated successfully, but these errors were encountered: