R16SAFEfunction

Overload Added

Flags when a new function overload is added. Existing callers are unaffected.


Applies to

TypeScriptJava

Why it matters

Adding an overload expands the function's call signatures. All existing callers remain valid.

Example

Before
// parser.ts
export function parse(input: string): AST;
export function parse(input: string): AST { ... }
After (new overload)
// parser.ts (SAFE — new overload)
export function parse(input: string): AST;
export function parse(input: Buffer): AST;
export function parse(input: string | Buffer): AST { ... }

What you see in the terminal

$ npx dg check

  [SAFE] parse (signature_change)
  src/parser.ts:2
  New function overload added. Existing callers are unaffected.

How detection works

The classifier detects when the new signature has more overloads than the old one and reports it as safe.

Real-world scenario

A library adds a Buffer overload to a parse function. All existing string callers continue to work.