Skip to content

[SR-13167] Parse: add parsing/syntax support for @differentiable(default, ...) #55609

@dan-zheng

Description

@dan-zheng
Previous ID SR-13167
Radar rdar://problem/69987999
Original Reporter @dan-zheng
Type Sub-task
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Sub-task
Assignee None
Priority Medium

md5: dc508f6543b2cdff61b1f36c59bd25d9

Parent-Task:

  • SR-13166 Default derivative implementations for protocol requirements

Issue Description:

See relevant section from the differentiable programming manifesto: https://github.com/apple/swift/blob/master/docs/DifferentiableProgramming.md#default-derivatives-and-transposes.

The optional "default" component should appear after the optional "linear" component and before the optional "wrt:" clause.

The following ~fully elaborated @differentiable attribute should parse and pass syntax testing (but doesn't type-check).

@differentiable(linear, default, wrt: (x, y) where T: FloatingPoint)
func foo<T>(_ x: T, _ y: T) -> T {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions