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

[MVUX] Model with no namespace set causes FeedsGenerator error #2213

Open
16 tasks
nickrandolph opened this issue Mar 21, 2024 · 0 comments
Open
16 tasks

[MVUX] Model with no namespace set causes FeedsGenerator error #2213

nickrandolph opened this issue Mar 21, 2024 · 0 comments
Assignees
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.

Comments

@nickrandolph
Copy link
Contributor

nickrandolph commented Mar 21, 2024

Current behavior

Since namespaces are not mandatory, you can create a model in the global namespace eg

public partial record MainModel():

Unfortunately this causes a FeedsGenerator

...Uno.Extensions.Reactive.Generator\Uno.Extensions.Reactive.Generator.FeedsGenerator\MainModel.g.cs(15,68,15,85): error CS0400: The type or namespace name 'BindableMainModel' could not be found in the global namespace (are you missing an assembly reference?)

This seems to be because in the ViewModelMappings file we end up with:

public static readonly global::System.Collections.Generic.IDictionary<global::System.Type, global::System.Type> ViewModelMappings = new global::System.Collections.Generic.Dictionary<global::System.Type, global::System.Type>
		{
			{ typeof(MainModel), typeof(global::BindableMainModel) },
			{ typeof(TubePlayerWithAuth.Presentation.LoginModel), typeof(global::TubePlayerWithAuth.Presentation.BindableLoginModel) },
			{ typeof(TubePlayerWithAuth.Presentation.SecondModel), typeof(global::TubePlayerWithAuth.Presentation.BindableSecondModel) },
		};

But BindableMainModel isn't found in the global namespace (hence the error!)

Expected behavior

No error, or a meaningful warning

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

Environment

Nuget Package (s):

Package Version(s):

Affected platform(s):

  • iOS
  • macOS (AppKit)
  • Mac Catalyst
  • Android
  • WebAssembly
  • Windows
  • Skia (WPF)
  • Skia (GTK on Linux/macOS/Windows)
  • Skia (Linux Framebuffer)
  • Build tasks

Visual Studio:

  • 2019 (version: )
  • 2022 (version: )
  • Visual Studio Code (version: )
  • Rider Windows (version: )
  • Rider macOS (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

@nickrandolph nickrandolph added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.
Projects
None yet
Development

No branches or pull requests

2 participants