Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0d9ffd724814a09ac70577c710bce66b80b6f1bd6a2a8621aba8b401cd322785
Ticket: 8ab06e31e3af6141118a547d52e4636fba9ef252
Compiled [self n] returns the namespace instead of an ambiguous subcommand error
User & Date: jan.nijtmans on 2026-10-18 21:14:13
Changes

  1. assignee changed to: "jan.nijtmans"
  2. closer changed to: "nobody"
  3. 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.
    
  4. icomment:
    Now merged to [7cd1d5bbe9|trunk] and core-9-0-branch.
    
    Merge to core-8-6-branch still to be done.
    
  5. login: "jan.nijtmans"
  6. mimetype: "text/x-fossil-wiki"
  7. resolution changed to: "Fixed"
  8. status changed to: "Pending"