mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Now that we have lazy metadata accessors for classes and vtable thunking, we don't have any reason to prevent concrete subclasses of generic base classes. Wire up IRGen to lazily instantiate the superclass for concrete derived classes when their metadata is accessed, using a runtime function that installs all the necessary pointers and metadata and registers the fully-initialized class with the ObjC runtime. Swift SVN r28520
12 lines
156 B
Swift
12 lines
156 B
Swift
// RUN: %target-parse-verify-swift
|
|
|
|
class Base<T> {
|
|
class func f(arg: T) -> Int {
|
|
return 0
|
|
}
|
|
}
|
|
|
|
class Derived : Base<Int> {}
|
|
|
|
var a = Derived.f(42)
|