racket / macro-debugger

Other
8 stars 16 forks source link

Macro stepper error (steps): failed pattern match against (?firstL . ?rest) #14

Closed SuzanneSoy closed 4 years ago

SuzanneSoy commented 8 years ago

The macro debugger gives an error Macro stepper error (steps) on the following file:

#lang racket

(module t/u racket
  (provide typed/untyped-typed)

  (require racket/require-syntax
           (for-syntax syntax/strip-context))

  (define-require-syntax (typed/untyped-typed stx)
    (syntax-case stx ()
      [(_ m s) (replace-context stx #'(submod m s typed))])))

(module m racket
  (module typed typed/racket
    (provide spring-flowers)
    (define (spring-flowers) : (Listof Symbol) '(jonquil snowdrop))))

;; Note that the test module uses racket,
;; but the required module (submod ".." m typed") uses typed racket.
(module test racket
  (require (submod ".." t/u))

  (require (typed/untyped-typed ".." m))

  (spring-flowers))

Here is the error message:

with-syntax1: failed pattern match against (?firstL . ?rest)
  in: ()
  context...:
   /nix/store/5xgyl65ilsmgzv8qc8y9s1zi0xy37kx4-racket-6.4.0.8/share/racket/pkgs/macro-debugger-text-lib/macro-debugger/model/reductions-engine.rkt:62:7
   /nix/store/5xgyl65ilsmgzv8qc8y9s1zi0xy37kx4-racket-6.4.0.8/share/racket/pkgs/macro-debugger-text-lib/macro-debugger/model/reductions-engine.rkt:396:0: run-one
   /nix/store/5xgyl65ilsmgzv8qc8y9s1zi0xy37kx4-racket-6.4.0.8/share/racket/pkgs/macro-debugger-text-lib/macro-debugger/model/reductions-engine.rkt:396:0: run-one
   /nix/store/5xgyl65ilsmgzv8qc8y9s1zi0xy37kx4-racket-6.4.0.8/share/racket/pkgs/macro-debugger-text-lib/macro-debugger/model/reductions-engine.rkt:396:0: run-one
   /nix/store/5xgyl65ilsmgzv8qc8y9s1zi0xy37kx4-racket-6.4.0.8/share/racket/pkgs/macro-debugger-text-lib/macro-debugger/model/reductions-engine.rkt:396:0: run-one
   /nix/store/5xgyl65ilsmgzv8qc8y9s1zi0xy37kx4-racket-6.4.0.8/share/racket/pkgs/macro-debugger-text-lib/macro-debugger/model/reductions-engine.rkt:396:0: run-one
   /nix/store/5xgyl65ilsmgzv8qc8y9s1zi0xy37kx4-racket-6.4.0.8/share/racket/pkgs/macro-debugger-text-lib/macro-debugger/model/reductions-engine.rkt:325:25
   /nix/store/5xgyl65ilsmgzv8qc8y9s1zi0xy37kx4-racket-6.4.0.8/share/racket/pkgs/macro-debugger-text-lib/macro-debugger/model/reductions-engine.rkt:396:0: run-one
   /nix/store/5xgyl65ilsmgzv8qc8y9s1zi0xy37kx4-racket-6.4.0.8/share/racket/pkgs/macro-debugger-text-lib/macro-debugger/model/reductions-engine.rkt:396:0: run-one
   /nix/store/5xgyl65ilsmgzv8qc8y9s1zi0xy37kx4-racket-6.4.0.8/share/racket/pkgs/macro-debugger-text-lib/macro-debugger/model/reductions-engine.rkt:68:6: continue
   /nix/store/5xgyl65ilsmgzv8qc8y9s1zi0xy37kx4-racket-6.4.0.8/share/racket/pkgs/macro-debugger-text-lib/macro-debugger/model/reductions-engine.rkt:396:0: run-one
   /nix/store/5xgyl65ilsmgzv8qc8y9s1zi0xy37kx4-racket-6.4.0.8/share/racket/pkgs/macro-debugger-text-lib/macro-debugger/model/reductions-engine.rkt:325:25
   /nix/store/5xgyl65ilsmgzv8qc8y9s1zi0xy37kx4-racket-6.4.0.8/share/racket/pkgs/macro-debugger-text-lib/macro-debugger/model/reductions-engine.rkt:396:0: run-one
   /nix/store/5xgyl65ilsmgzv8qc8y9s1zi0xy37kx4-racket-6.4.0.8/share/racket/pkgs/macro-debugger-text-lib/macro-debugger/model/reductions-engine.rkt:68:6: continue
   /nix/store/5xgyl65ilsmgzv8qc8y9s1zi0xy37kx4-racket-6.4.0.8/share/racket/pkgs/macro-debugger-text-lib/macro-debugger/model/reductions-engine.rkt:396:0: run-one
   /nix/store/5xgyl65ilsmgzv8qc8y9s1zi0xy37kx4-racket-6.4.0.8/share/racket/pkgs/macro-debugger-text-lib/macro-debugger/model/reductions-engine.rkt:325:25
   ...

I attached the file generated by clicking on "dump debugging file".

bennn commented 8 years ago

Here's another program with the same issue.

#lang racket

(module id typed/racket
  (: id (-> (Vectorof Integer) (Vectorof Integer)))
  (define (id x) x)
  (provide id))

(require 'id)
id
rmculpepper commented 8 years ago

Diagnosis: This happens whenever a require is lifted during pass 1 of the module-begin expansion.

rmculpepper commented 4 years ago

Fixed by the recent update.