示例#1
0
 public FunctionDefinition GetConstructorByContract(ContractDefinition contract)
 {
     if (ContractToConstructorMap.ContainsKey(contract))
     {
         return(ContractToConstructorMap[contract]);
     }
     throw new System.Exception($"Contract {contract.Name} does not have any constructors");
 }
示例#2
0
 public bool IsConstructorDefined(ContractDefinition contract)
 {
     return(ContractToConstructorMap.ContainsKey(contract));
 }
示例#3
0
 public void AddConstructorToContract(ContractDefinition contract, FunctionDefinition ctor)
 {
     Debug.Assert(ctor.IsConstructorForContract(contract.Name), $"{ctor.Name} is not a constructor");
     Debug.Assert(!ContractToConstructorMap.ContainsKey(contract), $"Multiple constructors are defined");
     ContractToConstructorMap[contract] = ctor;
 }