s LearnSqueak.com

SMALLTALK UPDATES · ISSUE 23

One trait method, one class with a warning

Two classes use the same Squeak trait method. Only one owns a field with the same name as the method’s local variable. A proposal shows how to report that difference.

Published · Curated links & context

WHAT CAUGHT OUR EYE

News & articles

Dates below belong to the original sources. Evergreen resources are labeled separately from dated news.

DEVELOPMENT NEWS · SQUEAK INBOX PROPOSAL

Can you predict which class gets named?

Christoph Thiede posted three related packages to the Squeak Inbox. In the published test, two classes use the same trait. Class A has an instance variable named inst1, and class B does not. The trait method shadow declares a temporary also named inst1. Inside the method, the local name hides A’s instance variable; it does not change the value in that field. The test expects a single record in the grouped warning: class A, selector #shadow, variable inst1. Changing the example to a fresh local inst2 is expected to produce no grouped warning. A second test scenario expects only class C to be reported when C, which already has the conflicting field, adopts the trait.

Why explore it?

Traits share behavior, so a single source method can encounter different fields in the classes that use it. The proposed Traits change groups the warnings. The companion Browser change can show the details when interactive warnings are enabled; its handler resumes rather than rejecting the change. Read the class and selector in the notice before deciding what name to rename.

A shared trait method declares local inst1. Class A has a field called inst1, while class B does not. The published test expects only A’s shadow method in the grouped warning.
Original LearnSqueak illustration of the expected test result, 21 November 2026. This is not a screenshot or a runtime result. Source

KEEP EXPLORING

Useful sites, tutorials & videos

A small shelf of learning resources. Older material is labeled so you can expect interface differences.

EVERGREEN · ORIGINAL PAPER

Where traits came from

Schärli, Ducasse, Nierstrasz and Black · ECOOP 2003

The original conference paper explains how groups of methods become reusable units of behavior. Read the introduction for the motivation, then return to the example above to see why the class provides important context.

About this edition

Published 21 November 2026. The packages were announced for the Squeak Inbox. We reviewed the posted diffs and test expectations; we did not run these packages or verify a Trunk merge. This proposal is not evidence about the Inbox Talk Refresh warning.

Back to all Smalltalk updates · Subscribe by RSS