Skip to content

guard against trait type piracy in a dependent package #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nsajko
Copy link

@nsajko nsajko commented May 11, 2025

Prevent dependent packages from commiting type piracy easily and unintentionally when defining an AbstractTrees trait for all subtypes of a type. Specifically: the bottom type, Union{}, is a subtype of each type, so add a method for the bottom type for each AbstractTrees trait. This method will take precedence over sane methods in dependent packages, thus preventing spurious type piracy.

@codecov-commenter
Copy link

codecov-commenter commented May 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.81%. Comparing base (5f09fa5) to head (af7eee8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #157      +/-   ##
==========================================
+ Coverage   71.16%   71.81%   +0.64%     
==========================================
  Files           8        8              
  Lines         437      447      +10     
==========================================
+ Hits          311      321      +10     
  Misses        126      126              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nsajko nsajko force-pushed the guard_against_trait_type_piracy_in_a_dependent_package branch 2 times, most recently from bbd9096 to 13728a5 Compare May 11, 2025 18:01
Prevent dependent packages from commiting type piracy easily and
unintentionally when defining an AbstractTrees trait for all subtypes
of a type. Specifically: the bottom type, `Union{}`, is a subtype of
each type, so add a method for the bottom type for each AbstractTrees
trait. This method will take precedence over sane methods in dependent
packages, thus preventing spurious type piracy.
@nsajko nsajko force-pushed the guard_against_trait_type_piracy_in_a_dependent_package branch from 13728a5 to af7eee8 Compare May 11, 2025 21:03
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.

2 participants