swift
e748f251 - [AutoDiff] Fix `@differentiable` attribute type-checking. (#22218)

Commit
6 years ago
[AutoDiff] Fix `@differentiable` attribute type-checking. (#22218) - Check whether parameter counts match in `checkFunctionSignature`. - Previously, parameter types were zipped and checked for equality, but parameter count equality was neglected. - Erase dynamic `Self` type during `@differentiable` attribute type-checking. - According to a doc comment, dynamic `Self` result types are relevant only for checking protocol conformances. Here, it disrupts associated type lookup and causes `getAutoDiffAssociatedVectorSpace` to fail. - Add test, fix incorrect VJP definition in stdlib.
Author
Parents
  • lib/Sema
    • File
      TypeCheckAttr.cpp
  • stdlib/public/core
    • File
      FloatingPoint.swift
  • test/AutoDiff
    • File
      differentiable_attr_type_checking.swift