Esempio n. 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");
 }
Esempio n. 2
0
 public bool IsConstructorDefined(ContractDefinition contract)
 {
     return(ContractToConstructorMap.ContainsKey(contract));
 }
Esempio n. 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;
 }