Re: [whatwg/webidl] Specify that dictionaries can't be the type of attr/constant (#940)

Okay, so principal requirement is this:

> The type of a constant (matching ConstType) must not be any type other than a primitive type. If an identifier is used, it must reference a typedef whose type is a primitive type.

Right? And this one:

> The type of the attribute, after resolving typedefs, must not be a nullable or non-nullable version of any of the following types:
>
> * a sequence type
> * a dictionary type
> * ...

I think that gives us two options for the sections on individual types:

* We don't say anything.
* We have notes with a statements of fact. "Note: can/cannot be used as a type of attribute/constant/???."

The latter option seems good, but would be a lot of additional work and if we want to do it consistently across all the various things, even more work.

I also think that means that this PR title is slightly misleading as it's already specified currently per those requirements I quoted. The problem is that some of these requirements are duplicated in other sections and others are not. I think for now the best course of action would be to remove the duplicate requirements, but if someone wants to add statements of fact to all types I won't stop them.

Hope that helps.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/pull/940#issuecomment-943107162

Received on Thursday, 14 October 2021 07:56:21 UTC