bikeshed
bikeshed copied to clipboard
Inference of `function` type and functional `type`
It seems that a function
and functional type
(ending with ()>
) cannot be inferred (does it end with ()
? Is it surrounded by <>
?), according to the result from processing the source below with (the online version of) Bikeshed:
<pre class=metadata>
Title: Test
Status: DREAM
ED: https://api.csswg.org/bikeshed/
Shortname: test
Level: 1
Editor: me
Abstract: Bikeshed test.
</pre>
<pre class="prod def">
<dfn>inferred-fn()</dfn> <!-- unexpected: data-dfn-type is "dfn" instead of "function" whereas it ends with () -->
</pre>
<pre class="prod def">
<dfn function>explicit-fn()</dfn>
<dfn><type-a></dfn> = <<explicit-fn()>>
<dfn><type-b></dfn> = ''explicit-fn()'' <!-- type is "maybe" -->
</pre>
<pre class="prod def">
<dfn><inferred-type()></dfn> <!-- unexpected: data-dfn-type is "dfn" instead of "type" whereas it is surrounded by <> -->
</pre>
<pre class="prod def">
<dfn type><explicit-type()></dfn>
<dfn><type-c></dfn> = <<explicit-type()>> <!-- LINK ERROR (no ref) -->
<dfn><type-d></dfn> = ''<<explicit-type()>>'' <!-- no link is created -->
</pre>
As commented in the source, not being able to link to a functional type
(because <<fn()>>
always links to a function
) seems problematic. For example, in CSS Mixins (source):
<dfn><<css-type>></dfn> = <<syntax-component>> | <<type()>> <dfn><type()></dfn> = type( <<syntax>> )
<<type()>>
does not link to the type
definition on the next line, but to the (inlined) function
in CSS Images 4.
If I remember correctly and understood correctly, function
exists to avoid a name collision between value
and value()
. But I do not see why we could not link to a function
using ''value()''
rather than <<value()>>
, nor why function
and functional type
could not be inferred as expected.