Files
swift-mirror/test/Generics/non_generic_derived_class.swift
Joe Groff c97ba8e914 IRGen: Allow concrete subclasses of generic base classes.
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
2015-05-13 18:54:03 +00:00

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)