Commit Graph

12 Commits

Author SHA1 Message Date
Robert Widmann
1beb75583a Push FunctionTypeRepr Input Invariants Up
Validation of the input side of FunctionTypeRepr was previously being done in Sema because of expression folding.  If we instead push the invariant that the input TypeRepr should always be a TupleTypeRepr into the AST a number of nice cleanups fall out:

- The SIL Parser no longer accepts Swift 2-style type declarations
-  Parse is more cleanly able to reject invalid FunctionTypeReprs
- Clients of the AST can be assured the input type is always a TupleType so we can flush Swift 2 hacks
2018-06-13 18:41:20 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Robert Widmann
4f465224ea Polish off uses of dynamicType in tests 2016-07-29 16:59:14 -07:00
Chris Lattner
226a675ffc Update more tests to use ()'s around function types. 2016-05-06 21:07:08 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
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