Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some failure tests for inheritance
- Loading branch information
Showing
5 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Plinth Test | ||
// Compiler: ClassCycle.pth: 9:1-26: Cyclic inheritance hierarchy detected: Alpha extends itself (perhaps indirectly). | ||
// Compiler: ClassCycle.pth: 13:1-28: Cyclic inheritance hierarchy detected: Bravo extends itself (perhaps indirectly). | ||
// Compiler: ClassCycle.pth: 16:1-28: Cyclic inheritance hierarchy detected: Charlie extends itself (perhaps indirectly). | ||
// Compiler: ClassCycle.pth: 20:1-28: Cyclic inheritance hierarchy detected: Delta extends itself (perhaps indirectly). | ||
// Compiler: ClassCycle.pth: 23:1-25: Cyclic inheritance hierarchy detected: Echo extends itself (perhaps indirectly). | ||
// Compiler: ClassCycle.pth: 26:1-27: Cyclic inheritance hierarchy detected: Foxtrot extends itself (perhaps indirectly). | ||
|
||
class Alpha extends Alpha | ||
{ | ||
} | ||
|
||
class Bravo extends Charlie | ||
{ | ||
} | ||
class Charlie extends Bravo | ||
{ | ||
} | ||
|
||
class Delta extends Foxtrot | ||
{ | ||
} | ||
class Echo extends Delta | ||
{ | ||
} | ||
class Foxtrot extends Echo | ||
{ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Plinth Test | ||
// Compiler: InterfaceCycle.pth: 8:1-30: Cyclic inheritance graph detected: Alpha extends itself (perhaps indirectly) | ||
// Compiler: InterfaceCycle.pth: 12:1-39: Cyclic inheritance graph detected: Bravo extends itself (perhaps indirectly) | ||
// Compiler: InterfaceCycle.pth: 15:1-32: Cyclic inheritance graph detected: Charlie extends itself (perhaps indirectly) | ||
// Compiler: InterfaceCycle.pth: 25:1-37: Cyclic inheritance graph detected: Foxtrot extends itself (perhaps indirectly) | ||
// Compiler: InterfaceCycle.pth: 28:1-37: Cyclic inheritance graph detected: Golf extends itself (perhaps indirectly) | ||
|
||
interface Alpha extends Alpha | ||
{ | ||
} | ||
|
||
interface Bravo extends Charlie, Alpha | ||
{ | ||
} | ||
interface Charlie extends Bravo | ||
{ | ||
} | ||
|
||
interface Delta | ||
{ | ||
} | ||
interface Echo extends Delta | ||
{ | ||
} | ||
interface Foxtrot extends Golf, Echo | ||
{ | ||
} | ||
interface Golf extends Echo, Foxtrot | ||
{ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Plinth Test | ||
// Compiler: ClassInheritance.pth: 7:1-27: A class may not extend a compound type | ||
// Compiler: ClassInheritance.pth: 14:1-28: A class may not extend an interface | ||
// Compiler: ClassInheritance.pth: 21:1-28: A class may not implement another class | ||
// Compiler: ClassInheritance.pth: 25:1-32: A class may not implement a compound type | ||
|
||
class Alpha extends string | ||
{ | ||
} | ||
|
||
interface Bravo | ||
{ | ||
} | ||
class Charlie extends Bravo | ||
{ | ||
} | ||
|
||
class Delta | ||
{ | ||
} | ||
class Echo implements Delta | ||
{ | ||
} | ||
|
||
class Foxtrot implements string | ||
{ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Plinth Test | ||
// Compiler: InterfaceInheritance.pth: 8:1-30: An interface may not extend a class | ||
// Compiler: InterfaceInheritance.pth: 12:1-33: An interface may not extend a compound type | ||
|
||
class Alpha | ||
{ | ||
} | ||
interface Bravo extends Alpha | ||
{ | ||
} | ||
|
||
interface Charlie extends string | ||
{ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Plinth Test | ||
// Compiler: Linearisation.pth: 14:1-38: Cannot find a good linearisation for the inheritance hierarchy of Charlie: cannot decide which of the following super-types should be preferred: | ||
// Compiler: Alpha | ||
// Compiler: Bravo | ||
|
||
interface Alpha | ||
{ | ||
} | ||
|
||
interface Bravo extends Alpha | ||
{ | ||
} | ||
|
||
class Charlie implements Alpha, Bravo | ||
{ | ||
} | ||
|