Skip to content

Commit ea61947

Browse files
Checking the hierarchy of Any and its eigentype
1 parent 2cd8f4d commit ea61947

File tree

1 file changed

+23
-0
lines changed
  • engine/runtime-integration-tests/src/test/java/org/enso/interpreter/node/expression/builtin/meta

1 file changed

+23
-0
lines changed

engine/runtime-integration-tests/src/test/java/org/enso/interpreter/node/expression/builtin/meta/TypeChainTest.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,27 @@ public void textModuleChain() {
7878
assertArrayEquals(
7979
"Text.type and Any", new Object[] {exp1, exp2}, rawType.allTypes(ctx.ensoContext()));
8080
}
81+
82+
@Test
83+
public void anyChain() {
84+
var any = ctx.ensoContext().getBuiltins().any();
85+
var anyType = typeOf.execute(any);
86+
var raw = (Type) ctx.unwrapValue(anyType);
87+
var all = raw.allTypes(ctx.ensoContext());
88+
89+
var exp1 = any.getEigentype();
90+
assertArrayEquals("Any.type only", new Object[] {exp1}, all);
91+
}
92+
93+
@Test
94+
public void anyEigeintypeChain() {
95+
var any = ctx.ensoContext().getBuiltins().any();
96+
var anyType = typeOf.execute(any);
97+
var anyTypeType = typeOf.execute(anyType);
98+
var raw = (Type) ctx.unwrapValue(anyTypeType);
99+
var all = raw.allTypes(ctx.ensoContext());
100+
101+
var exp1 = any.getEigentype();
102+
assertArrayEquals("Any.type only", new Object[] {exp1}, all);
103+
}
81104
}

0 commit comments

Comments
 (0)