Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inference of function type and functional type #2906

Open
cdoublev opened this issue Aug 7, 2024 · 0 comments
Open

Inference of function type and functional type #2906

cdoublev opened this issue Aug 7, 2024 · 0 comments

Comments

@cdoublev
Copy link

cdoublev commented Aug 7, 2024

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>&lt;type-a></dfn> = <<explicit-fn()>>
  <dfn>&lt;type-b></dfn> = ''explicit-fn()'' <!-- type is "maybe" -->
</pre>
<pre class="prod def">
  <dfn>&lt;inferred-type()></dfn> <!-- unexpected: data-dfn-type is "dfn" instead of "type" whereas it is surrounded by <> -->
</pre>
<pre class="prod def">
  <dfn type>&lt;explicit-type()></dfn>
  <dfn>&lt;type-c></dfn> = <<explicit-type()>> <!-- LINK ERROR (no ref) -->
  <dfn>&lt;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>&lt;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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant