HomePhabricator

[clang-format] Fix C# nullable-related errors

Authored by exv on May 6 2021, 3:06 AM.

Description

[clang-format] Fix C# nullable-related errors

This fixes two errors:

Previously, clang-format was splitting up type identifiers from the
nullable ?. This changes this behavior so that the type name sticks with
the operator.

Additionally, nullable operators attached to return types in interface
functions were not parsed correctly. Digging deeper, it looks like
interface bodies were being parsed differently than classes and structs,
causing MustBeDeclaration to be incorrect for interface members. They
now share the same logic.

One other change is reintroducing the CSharpNullable type independent of
JsTypeOptionalQuestion. Despite having a similar semantic purpose, their
actual syntax differs quite a bit.

Reviewed By: MyDeveloperDay, curdeius

Differential Revision: https://reviews.llvm.org/D101860

Details

Committed
curdeiusMay 6 2021, 3:11 AM
Reviewer
MyDeveloperDay
Differential Revision
D101860: [clang-format] Fix C# nullable-related errors
Parents
rGa437befa8f85: [clang-format] Add more support for C# 8 nullables
Branches
Unknown
Tags
Unknown