Skip to content
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

constrain the path argument of include functions to AbstractString #55466

Commits on Aug 11, 2024

  1. constrain the path argument of include functions to AbstractString

    Each `Module` defined with `module` automatically gets an `include`
    function with two methods. Each of those two methods takes a file path
    as its last argument. Even though the path argument is unconstrained by
    dispatch, it's documented as constrained with `::AbstractString`:
    
    https://docs.julialang.org/en/v1.11-dev/base/base/#include
    
    Furthermore, I think that any invocation of `include` with a
    non-`AbstractString` path will necessarily throw a `MethodError`
    eventually. Thus this change should be harmless.
    
    Adding the type constraint to the path argument is an improvement
    because any possible exception would be thrown earlier than before.
    
    Apart from modules defined with `module`, the same issue is present
    with the anonymous modules created by `evalfile`, which is also
    addressed.
    
    Sidenote: `evalfile` seems to be completely untested apart from the
    test added here.
    nsajko committed Aug 11, 2024
    Configuration menu
    Copy the full SHA
    e549b7f View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2024

  1. Configuration menu
    Copy the full SHA
    4f70d10 View commit details
    Browse the repository at this point in the history