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); }
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)); }
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)); }