Skip to content

Conversation

@pschuh
Copy link
Contributor

@pschuh pschuh commented Jan 26, 2019

Currently a mismatch between differentiable attributes on protocol and structs that conform to that protocol will result in a runtime error.

This PR adds a diagnostic error that always requires that these functions be differentiable.

This is an example of the diagnostic that is produced when this happens:

test2.swift:9:8: error: type 'ConformingWithErrors' does not conform to protocol 'DiffReq'
struct ConformingWithErrors : DiffReq {
^
test2.swift:10:8: note: candidate is missing differentiable attribute '@differentiable(wrt: (x, self)) '
func f1(_ x: Float) -> Float {
^
test2.swift:3:8: note: protocol requires function 'f1' with type '(Float) -> Float'; do you want to add a stub?
func f1(_ x: Float) -> Float
^

@pschuh pschuh requested review from dan-zheng and rxwei January 26, 2019 05:17
@pschuh
Copy link
Contributor Author

pschuh commented Jan 26, 2019

@swift-ci please test tensorflow

1 similar comment
@pschuh
Copy link
Contributor Author

pschuh commented Jan 26, 2019

@swift-ci please test tensorflow

Copy link
Contributor

@dan-zheng dan-zheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@pschuh
Copy link
Contributor Author

pschuh commented Jan 26, 2019

@swift-ci please test tensorflow

1 similar comment
@pschuh
Copy link
Contributor Author

pschuh commented Jan 26, 2019

@swift-ci please test tensorflow

Copy link
Contributor

@rxwei rxwei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great patch!

@pschuh
Copy link
Contributor Author

pschuh commented Jan 26, 2019

@swift-ci please test tensorflow

2 similar comments
@pschuh
Copy link
Contributor Author

pschuh commented Jan 26, 2019

@swift-ci please test tensorflow

@pschuh
Copy link
Contributor Author

pschuh commented Jan 26, 2019

@swift-ci please test tensorflow

@pschuh
Copy link
Contributor Author

pschuh commented Jan 26, 2019

@swift-ci please test tensorflow macos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants