Commit Graph

7 Commits

Author SHA1 Message Date
Chris Willmore
983a674e0c Make use of curried function declaration syntax an error.
<rdar://problem/23111018>
2016-01-20 21:57:38 -08:00
Slava Pestov
9deaf6c851 Sema: Fixes for partial application of protocol methods
Previously the placement of the OpenExistentialExpr was determined
entirely from the natural argument count of the function.

There was a hack to add any missing OpenExistentialExprs at the top
level, but this didn't work if the method had a Self return value
and there were intermediate expressions, eg, if someMethod has a
Self return, foo(anExistential.someMethod) would generate a
diagnostic about open existentials.

Change ExprRewriter to use a new existential placement algorithm
that instead walks up the expression stack to determine the outermost
function application of an existential base, and insert the
OpenExistentialExpr there.

Progress on <rdar://problem/21289579>.

Swift SVN r29448
2015-06-17 07:42:47 +00:00
Slava Pestov
7319a97ab4 Sema: Rewrite witness method calls as ApplyExpr + DeclRefExpr
Special-casing these as MemberRefExprs created an asymmetry
where unbound archetype instance methods (<T : P> T.f) could
not be represented. Treating class and protocol methods
uniformly also eliminates a handful of special cases around
MemberRefExpr.

SILGen's RValue and call emission peepholes now have to know
about DeclRefExprs that point to protocol methods.

Finally, generalize the diagnostic for partially applied
mutating methods to any partially applied function with an
inout parameter, since this is not supported.

Fixes <rdar://problem/20564672>.

Swift SVN r29298
2015-06-04 15:57:58 +00:00
Arnold Schwaighofer
859fbc0162 More executable_test for the test directory
Swift SVN r29280
2015-06-03 23:28:51 +00:00
Dmitri Hrybenko
f46f16ae82 stdlib: implement new print() API
rdar://20775683

Swift SVN r28309
2015-05-08 01:37:59 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
John McCall
dce0931793 Remove an over-aggressive assert. Curried methods work in
protocols; we treat the method's natural uncurrying level as
the specified level.

Swift SVN r14053
2014-02-18 22:16:53 +00:00