Files
swift-mirror/test/embedded/self-referential-managed-buffer.swift
Erik Eckstein 3243f87204 tests: remove the lit feature swift_in_compiler
Tests require the compiler built with SwiftCompilerSources since a long time.
So this lit feature was redundant anyway. We can remove it.
2026-06-30 14:47:56 +02:00

10 lines
579 B
Swift

// RUN: %target-swift-frontend -typecheck %s -enable-experimental-feature Embedded -verify
// REQUIRES: swift_feature_Embedded
// Self-referential generic superclass should be diagnosed in Embedded Swift
// because it creates a circular metadata dependency.
final class Tree: ManagedBuffer<Int, Tree> { // expected-error {{class 'Tree' cannot inherit from 'ManagedBuffer<Int, Tree>' in Embedded Swift because a generic argument of the superclass refers to the subclass itself, creating a circular metadata dependency}}
var children: AnySequence<Tree> { AnySequence([]) }
}