Skip to content

Remove duplicated code across ASTTransformer, CodePrinter, Context, Trivia, Daemon#3375

Closed
MelbourneDeveloper wants to merge 3 commits into
fsprojects:mainfrom
MelbourneDeveloper:mergedupes
Closed

Remove duplicated code across ASTTransformer, CodePrinter, Context, Trivia, Daemon#3375
MelbourneDeveloper wants to merge 3 commits into
fsprojects:mainfrom
MelbourneDeveloper:mergedupes

Conversation

@MelbourneDeveloper

@MelbourneDeveloper MelbourneDeveloper commented Jul 5, 2026

Copy link
Copy Markdown

Seven byte-identical blocks were copy-pasted across five files, mostly where the impl and sig paths (or the short and long paths) grew by duplication. Each pair folds into one shared definition:

  • ASTTransformer: mkAnonRecordFields, mkTypeDefnObjectModelKind, mkModuleOrNamespaceHeader
  • CodePrinter: the long branch was an identical +> pipeline of short, so reuse short
  • Context: trimTrailingSpaces
  • Trivia: parsedInputTrivia
  • Daemon: configForRequest

No behaviour change.

Fixes #3374

Dupes found with Deslop.live
Deslop

@nojaf

nojaf commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for having a go at this. Not a change we want to take on, so I'm closing.

@nojaf nojaf closed this Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove duplicated mk*/config/trivia blocks in ASTTransformer, CodePrinter, Context, Trivia, Daemon

2 participants