mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Wire up the request-evaluator with an instance in ASTContext, and introduce two request kinds: one to retrieve the superclass of a class declaration, and one to compute the type of an entry in the inheritance clause. Teach ClassDecl::getSuperclass() to go through the request-evaluator, centralizing the logic to compute and extract the superclass type. Fixes the crasher from rdar://problem/26498438.
41 lines
446 B
Swift
41 lines
446 B
Swift
// RUN: not %target-swift-frontend %s -typecheck
|
|
|
|
class C { }
|
|
|
|
protocol PI
|
|
{
|
|
init()
|
|
}
|
|
|
|
protocol MDS
|
|
{
|
|
associatedtype Index : PI
|
|
func f(_ : MVC<Index, Self>, atIndex index : Index) -> C?
|
|
}
|
|
|
|
class MVC<Index : PI, DataSource : MDS>: C where DataSource.Index == Index
|
|
{
|
|
|
|
}
|
|
|
|
struct LPI : PI
|
|
{
|
|
var x : Int
|
|
var y : Int
|
|
}
|
|
|
|
extension LPI
|
|
{
|
|
init()
|
|
{
|
|
x = 0
|
|
y = 0
|
|
}
|
|
}
|
|
|
|
|
|
class LPVC: MVC<LPI, LPVC>
|
|
{
|
|
|
|
}
|