mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Accept any record wire on an input read only for its attributes
An element generic declared on a reading input, absent from the output and from every other input, has nowhere to go and nothing to be: the node reads its declared attributes and never the element. That is an attr-to-element map, so it accepts any upstream record wire. The blessing is inferred rather than marked, since the signature already says it. The two substrate pieces were both in place: the element rides as the byte-carried token, so the registry takes one generic row instead of a row per element type, and the reads resolve against the input's own layout as they always have. Only the passthrough rule stood in the way, in the three places that enforced it. A generic the output carries, or one on an input with no reads, is unchanged and still owes an implementations list. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -397,10 +397,10 @@ pub fn write_attribute<'e, T, V: WireValue>(
|
||||
/// A name written at another value type is a graph error rather than a
|
||||
/// conversion, so reading a number is never a coercion of one.
|
||||
#[node_macro::node(category("Attributes: Read"))]
|
||||
pub fn read_number_attribute<'e>(
|
||||
pub fn read_number_attribute<'e, T>(
|
||||
_: impl Ctx,
|
||||
/// The content whose lanes carry the attribute.
|
||||
(content, value): (f64, Attr<'e, Named<Name0, f64>>),
|
||||
/// The content whose lanes carry the attribute; its element is never read.
|
||||
(content, value): (T, Attr<'e, Named<Name0, f64>>),
|
||||
/// The attribute name, folded into an offset when the graph compiles.
|
||||
name: Named<Name0>,
|
||||
) -> f64 {
|
||||
|
||||
Reference in New Issue
Block a user