Skip to content

[SR-15808] [AutoDiff] Non-differentiable closure parameters not parsed correctly #58085

Closed as not planned
@philipturner

Description

@philipturner
Previous ID SR-15808
Radar None
Original Reporter @philipturner
Type Bug

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee None
Priority Medium

md5: a3df518fba66afe2f96d3bbdb0bf649a

Issue Description:

The following code produces a compiler crash during SILGen because it skipped classifying the closure as <<error type>> during AST creation:

import _Differentiation

protocol DifferentiableCollection: Sequence {}

extension DifferentiableCollection {
  func differentiableMap(_ body: @differentiable (Void) -> Void) {
    fatalError()
  }
}

While this code, which correctly identifies the closure as <<error type>> during AST creation, does not crash the compiler:

import _Differentiation

protocol DifferentiableCollection: Sequence {}

extension DifferentiableCollection {
  func differentiableMap(_ body: @differentiable (Int) -> Void) {
    fatalError()
  }
}

The crash log is attached.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AutoDiffbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions