Skip to content

[SR-10532] Assertion failed: (conforms != equivClass->conformsTo.end()) #52932

@SusanDoggie

Description

@SusanDoggie
Previous ID SR-10532
Radar rdar://problem/50169558
Original Reporter @SusanDoggie
Type Bug
Status Resolved
Resolution Done
Environment

Swift 5

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, IRGen
Assignee @slavapestov
Priority Medium

md5: 5b1ae800fe04f78f4be7ad25bcc37128

Issue Description:

The following code shouldn't have any error but swift compiler get it wrong.

public protocol ScalarProtocol: ScalarMultiplicative where Self == Scalar {
    
}

public protocol ScalarMultiplicative {
    
    associatedtype Scalar : ScalarProtocol
    
}

public protocol MapReduceArithmetic : ScalarMultiplicative, Collection where Element : ScalarMultiplicative, Scalar == Element.Scalar {
    
}

public protocol Tensor : MapReduceArithmetic where Scalar : BinaryFloatingPoint, Element == Scalar {
    
    var magnitude: Scalar { get set }
}

extension Tensor {
    
    public var magnitude: Scalar {
        return self.reduce(0) { $0 + $1 * $1 }.squareRoot()
    }
}

Metadata

Metadata

Assignees

Labels

IRGenLLVM IR generationbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of software

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions