+package org.simantics.scl.compiler.tests.experimentation;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.simantics.scl.compiler.environment.Environment;
+import org.simantics.scl.compiler.environment.Environments;
+import org.simantics.scl.compiler.module.repository.ImportFailureException;
+import org.simantics.scl.compiler.tests.InitialRepository;
+import org.simantics.scl.compiler.types.Type;
+import org.simantics.scl.compiler.types.Types;
+import org.simantics.scl.compiler.types.exceptions.UnificationException;
+
+public class TestExistential {
+ @Test
+ public void testExistentialTypes() throws ImportFailureException, UnificationException {
+ Environment environment = InitialRepository.getDefaultEnvironment();
+ Type type1 = Environments.getType(environment, "?a -> String -> ?a");
+ Type type2 = Environments.getType(environment, "Integer -> ?b -> ?c");
+ Assert.assertEquals("a -> String -> a", type1.toString());
+ Assert.assertEquals("Integer -> a -> b", type2.toString());
+ Types.unify(type1, type2);
+ Assert.assertEquals("Integer -> String -> Integer", type1.toString());
+ }
+}