/** Type check the source file. */ public Node typeCheck(ContextVisitor tc) { boolean hasPublic = false; // Override method to not check for duplicate declarations. This will be // caught during type building. But, we need to allow duplicates to handle // overloaded typedefs. for (TopLevelDecl d : decls) { if (d instanceof X10ClassDecl && d.flags().flags().isPublic()) { if (hasPublic) { Errors.issue( tc.job(), new Errors.SourceContainsMoreThanOnePublicDeclaration(d.position()), this); } hasPublic = true; } } return this.hasBeenTypeChecked(true); }