Files
swift-mirror/test/decl/class/circular_inheritance.swift
Doug Gregor 6c80f64c6e Diagnostic circular class inheritance.
Break cycles agressively when we find circular class inheritance. The
stronger AST invariants prevent us from having to check for loops
everywhere in the front end.


Swift SVN r7325
2013-08-19 15:31:13 +00:00

6 lines
244 B
Swift

// RUN: %swift -parse %s -verify
class C : B { } // expected-error{{circular class inheritance 'C' -> 'B' -> 'A' -> 'C'}}
class B : A { } // expected-note{{class 'B' declared here}}
class A : C { } // expected-note{{class 'A' declared here}}