I was trying to bind the text of a button to a resource string.
nodeBind(button.firstChild).bind('text', 'resources.commands.save');
This in turn creates a PathObserver, which then creates a PropertyPath. PropertyPath uses smoke.nameToSymbol to convert each path segment into a Symbol.
The created PropertyPath was expected to have 3 symbols: #resources, #commands, and #save, but it actually contained #resources, null, and null.
Before transformation, smoke.nameToSymbol uses new Symbol(name); however, after transformation, smoke.nameToSymbol calls GeneratedSymbolConverterService.nameToSymbol, which uses a symbol cache. The cache didn't contain #commands and #save, so nodeBind failed.
/// Implements [SymbolConverterService] using a static configuration.
class GeneratedSymbolConverterService implements SymbolConverterService {
Map<Symbol, String> _names;
/// A map from strings to symbols (the reverse of [names]).
final Map<String, Symbol> _symbols;
GeneratedSymbolConverterService(StaticConfiguration configuration)
: _names = configuration.names,
_symbols = {} {
_names.forEach((k, v) { _symbols[v] = k; });
}
String symbolToName(Symbol symbol) => _names[symbol];
Symbol nameToSymbol(String name) => _symbols[name];
}