Exemplo n.º 1
0
        public TestScope Convert(Tpn <TestScope, TestExplictType, TestObject, TestOrType, TestMethod, TestValue, TestMember, TestTypeReference> .ITypeSolution typeSolution, Tpn <TestScope, TestExplictType, TestObject, TestOrType, TestMethod, TestValue, TestMember, TestTypeReference> .TypeProblem2.Scope from)
        {
            var members = typeSolution.GetMembers(from);
            var res     = new TestScope();

            foreach (var member in members)
            {
                res.members.Add(typeSolution.GetMember(member));
            }
            return(res);
        }
Exemplo n.º 2
0
        public TestMethod Convert(Tpn <TestScope, TestExplictType, TestObject, TestOrType, TestMethod, TestValue, TestMember, TestTypeReference> .ITypeSolution typeSolution, Tpn <TestScope, TestExplictType, TestObject, TestOrType, TestMethod, TestValue, TestMember, TestTypeReference> .TypeProblem2.Method from)
        {
            var members = typeSolution.GetMembers(from);
            var scope   = new TestScope();

            foreach (var member in members)
            {
                scope.members.Add(typeSolution.GetMember(member));
            }
            var @ref = new Box <TestScope>();

            @ref.Fill(scope);
            return(new TestMethod(@ref));
        }
Exemplo n.º 3
0
        public TestValue Convert(Tpn <TestScope, TestExplictType, TestObject, TestOrType, TestMethod, TestValue, TestMember, TestTypeReference> .ITypeSolution typeSolution, Tpn <TestScope, TestExplictType, TestObject, TestOrType, TestMethod, TestValue, TestMember, TestTypeReference> .TypeProblem2.Value from)
        {
            var orType = typeSolution.GetType(from);

            IBox <ITestType> testType;

            if (orType.Is1(out var v1))
            {
                testType = typeSolution.GetExplicitType(v1);
            }
            else if (orType.Is2(out var v2))
            {
                testType = typeSolution.GetOrType(v2);
            }
            else
            {
                throw new Exception("well, should have been one of those");
            }
            return(new TestValue(testType));
        }