Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-13310] Unexpected "class member is not '@differentiable'" diagnostic #55750

Open
dan-zheng opened this issue Jul 28, 2020 · 0 comments
Open
Assignees
Labels
AutoDiff bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself

Comments

@dan-zheng
Copy link
Contributor

Previous ID SR-13310
Radar None
Original Reporter @dan-zheng
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, AutoDiff
Assignee @dan-zheng
Priority Medium

md5: 665ce04996a9742f44d55033340d329c

Issue Description:

import _Differentiation

class Class: Differentiable {
  var x: Float = 0
}

@differentiable
func foo(_ c: Class) -> Float {
  c.x
}
$ swiftc class.swift
class.swift:9:5: error: expression is not differentiable
  c.x
    ^
class.swift:9:5: note: member is not differentiable because the corresponding class member is not '@differentiable'
  c.x
    ^

This error is not expected because Differentiable derived conformances are expected to add @differentiable attributes to all "differentiation" stored properties (those used to synthesize TangentVector).

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoDiff bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself
Projects
None yet
Development

No branches or pull requests

1 participant