Skip to content

Adding #nullable may break sync generator #5080

Closed

Description

@MartinZikmund

Current behavior

Consider the following in PropertyValue class:

public static object CreateDoubleArray(double[]? value)

Doing this fails the Generator check in FindMatchingMethod(ITypeSymbol symbol, IMethodSymbol sourceMethod):

var sourceParams = sourceMethod.Parameters.Select(p => p.Type.ToDisplayString());
var targetParams = m.Parameters.Select(p => p.Type.ToDisplayString());
return sourceParams.SequenceEqual(targetParams);

Because of the additional ?.

Expected behavior

The generator should probably ignore nullable references?

How to reproduce it (as minimally and precisely as possible)

Workaround

Environment

Nuget Package:

  • Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
  • Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
  • Uno.SourceGenerationTasks
  • Uno.UI.RemoteControl / Uno.WinUI.RemoteControl
  • Other:

Nuget Package Version(s):

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Skia
    • WPF
    • GTK (Linux)
    • Tizen
  • Windows
  • Build tasks
  • Solution Templates

IDE:

  • Visual Studio 2017 (version: )
  • Visual Studio 2019 (version: )
  • Visual Studio for Mac (version: )
  • Rider Windows (version: )
  • Rider macOS (version: )
  • Visual Studio Code (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

Activity

  1. added
    kind/bug
    triage/untriaged
    area/code-generation
    and removed
    triage/untriaged
    on Jan 30, 2021
  2. added a commit that references this issue on Jan 30, 2021
  3. added
    difficulty/tbd
    on Feb 15, 2021
  4. added
    difficulty/medium 🤔
    and removed
    difficulty/tbd
    on Jun 3, 2021
  5. self-assigned this
    on Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/code-generationdifficulty/medium 🤔kind/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions