Skip to content

Every TypeSymbolWithAnnotations should have an explicit NonNullTypes context #28766

@jcouv

Description

@jcouv

We currently have some overload of Create which default to placeholder contexts (NonNullTypesTrueContext or NonNullTypesFalseContext).

Those overloads should be removed and proper/explicit contexts should be used in most places, if not all.

        ' The NonNullTypes context for nested tuple types is using a dummy rather than actual context from surrounding code.
        ' This does not affect `IsNullable`, but it affects `IsAnnotatedWithNonNullTypesContext`, which is used in comparisons.
        ' So when we copy modifiers (re-applying nullability information, including actual NonNullTypes context), we make the comparison fail.
        ' I think the solution is to never use a dummy context, even for value types.
        <Fact(Skip:="PROTOTYPE(NullableReferenceTypes): Hitting assertion in  CopyTypeCustomModifiers")>
        Public Sub TupleNamesFromCS001()

Relates to #28487

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions