We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
As reported by @LiberalArtist on the mailing list, struct contracts can be subverted if you have a sufficiently powerful inspector:
#lang racket (module s racket (provide (contract-out [struct must-be-integer ([v integer?])])) (struct must-be-integer (v))) (require racket/runtime-path) (define-runtime-module-path-index s-mpi '(submod "." s)) (define-values [struct:must-be-integer must-be-integer must-be-integer-v] (parameterize ([current-inspector (make-inspector)]) (values (dynamic-require s-mpi 'struct:must-be-integer) (dynamic-require s-mpi 'must-be-integer) (dynamic-require s-mpi 'must-be-integer-v)))) ; Succeeds, but shouldn’t! ((struct-type-make-constructor struct:must-be-integer) "not an integer") ; Also succeeds, but shouldn’t! (define-values [struct:must-be-integer* skipped?] (struct-info (must-be-integer 1))) ((struct-type-make-constructor struct:must-be-integer*) "not an integer")
This could be a source of unsoundness in Typed Racket, as reported in racket/typed-racket#787.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
As reported by @LiberalArtist on the mailing list, struct contracts can be subverted if you have a sufficiently powerful inspector:
This could be a source of unsoundness in Typed Racket, as reported in racket/typed-racket#787.
The text was updated successfully, but these errors were encountered: