Conversation
Introduce callables: values that can be "called" like functions. Add a new `call` declaration kind to represent callable methods.
| Args = TypeAndMaybePrivateName; Kind = Node::Kind::Allocator; break; | ||
| case 'c': | ||
| Args = TypeAndMaybePrivateName; Kind = Node::Kind::Constructor; break; | ||
| case 'F': |
There was a problem hiding this comment.
TODO: Add mangling/demangling tests.
Currently, there are no SIL tests for call declarations.
I informally checked that demangling works via -emit-silgen.
The old remangler might not work - haven't look into how to invoke/test it yet.
| @@ -1,8 +1,8 @@ | |||
| <s118><s163><s92><s13><NULL/><NULL/><t6>// REQUIRES: syntax_parser_lib | |||
| <s119><s164><s93><s13><NULL/><NULL/><t6>// REQUIRES: syntax_parser_lib | |||
There was a problem hiding this comment.
I’m not sure why changing this test to pass was necessary. I wonder if changing this test is breaking.
| EnumElement, | ||
| TypeAlias, | ||
| Subscript, | ||
| Call, |
There was a problem hiding this comment.
fyi will need a simple change to ModelASTWalker::walkToDeclPre() to actually emit this, and I think a possibly less-simple change to SyntaxModelContext::SyntaxModelContext() to classify tok::kw_call as identifer/keyword depending on context (this affects syntax highlighting).
- Use uniform naming: either "`call` member" or "`call` declaration". - Fix `call` member resolution during type-checking. - Enable more `func` attributes on `call` declarations. - Add tests.
|
The main callable functionality is done and tested: ready for review. |
|
@swift-ci build toolchain |
|
@swift-ci please build toolchain |
clang requires minor changes to support `call` declarations in Swift. Note: the clang remote should be reverted back to "apple/swift-clang".
- Parse "call" as identifier in patterns and enum case names. Add tests. - Disallow `@warn_unqualified_access` on `call` declarations. - Update failing attribute tests.
|
Sorry, building failed because this PR depends on some minor changes to clang to support I temporarily updated the clang version in I've verified that all swift tests pass locally. Retriggering toolchain build. |
|
@swift-ci Please build toolchain |
|
Investigating errors. |
|
@swift-ci Please build toolchain |
|
@swift-ci Please build toolchain macOS |
|
Linux Toolchain (Ubuntu 16.04) Install command |
|
@swift-ci Please build toolchain macOS |
|
macOS Toolchain Install command |
|
@swift-ci Please benchmark |
|
!!! Couldn't read commit file !!! |
|
@swift-ci please test source compatibility |
1 similar comment
|
@swift-ci please test source compatibility |
|
FWIW, SwiftLint (from the source compatibility suite) is failing with this error: |
|
Closing, as SE-0253 was returned for revision. |
Introduce callables: values that can be "called" like functions.
Add a new
calldeclaration kind to represent callable methods."Introducing callables" pitch. Proposal coming soon.