1. A method, comprising: receiving, while compiling a software program, source code comprising a resource-management statement that omits an exception-handling construct; detecting whether a resource within the resource-management statement is associated with an indicator, wherein the indicator indicates that a close method for the resource does not complete with a throwing of an exceptional event, wherein the exceptional event, if thrown, would be handled by the software program, and wherein the indicator is associated with type that is included in a type hierarchy of a programming language platform associated with the source code; if the resource is associated with the indicator, generating instructions that represent the resource-management statement, wherein the instructions, when executed, cause the resource to be closed without throwing the exceptional event, and wherein the generating involves: performing exception analysis on an implementation of the type and if the exception analysis finds that the close method of the implementation does not complete erroneously, permitting compilation of the implementation; and if there is no close method for the resource that does not complete with the throwing of the exceptional event, generating a compilation error.