예제 #1
0
        private void checkAbstractOnly(Context context, IMethodDeclaration declaration)
        {
            if (declaration.IsReference()) // parameter or variable populated from a method call
            {
                return;
            }
            if (declaration.getMemberOf() != null) // the category could be subclassed (if constructor called on abstract, that would raise an error anyway)
            {
                return;
            }
            // if a global method, need to check for runtime dispatch
            MethodFinder finder = new MethodFinder(context, this);
            ISet <IMethodDeclaration> potential = finder.findPotential();

            if (potential.All(decl => decl.isAbstract()))
            {
                throw new SyntaxError("Cannot call abstract method: " + declaration.getSignature(Dialect.O));
            }
        }
예제 #2
0
 public string getSignature(Dialect dialect)
 {
     return(wrapped.getSignature(dialect));
 }