Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2221850e001eb59e6a60b4909e74eac044334d718a764068563e776c86bd9c24
Ticket: 8ab06e31e3af6141118a547d52e4636fba9ef252
Compiled [self n] returns the namespace instead of an ambiguous subcommand error
User & Date: serhiy.storchaka on 2026-10-12 20:36:12
Changes

  1. cmimetype changed to: "text/x-fossil-wiki"
  2. comment changed to:
    <code>self n</code> is an error ("ambiguous subcommand "n": must be call,
    caller, class, filter, method, namespace, next, object, or target"), but in
    compiled code it is accepted as <code>self namespace</code>:
    
    <verbatim>
    oo::class create C {method m {} {self n}}
    [C new] m
    </verbatim>
    
    The compiler accepts any prefix of <code>namespace</code>, including
    <code>n</code>, which is also a prefix of <code>next</code>. It has done so
    since [acbaf52e6e]. <code>na</code> should be the shortest accepted prefix.
    Since this turns code that works now into an error, the fix is for the next
    feature release.
    
  3. foundin changed to: "8.6.18, 9.0.5, 9.1.0"
  4. login: "serhiy.storchaka"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. severity changed to: "Minor"
  8. status changed to: "Open"
  9. submitter changed to: "serhiy.storchaka"
  10. subsystem changed to: "47. Bytecode Compiler"
  11. title changed to:
    Compiled [self n] returns the namespace instead of an ambiguous subcommand error
    
  12. type changed to: "Bug"