[DDMD] [refactor] Move canInline into a free function