question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] TextAlignment Extension Throwing Compiler Error

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

if I extend the base Label class and implement the ILabel interface,

public class MyLabel : Label, ILabel
{

}

if I try to use the extended MyLabel class, text alignment extension will throw this exception

public MainPage()
{
	Content = new MyLabel
	{

	}.Center().TextCenter();
}
[CS0121](classifiedtextelementview-invokeaction:0): The call is ambiguous between the following methods or properties:
 'TextAlignmentExtensions_MyLabel.TextCenter<TAssignable>(TAssignable)' and 
'TextAlignmentExtensions_Label.TextCenter<TAssignable>(TAssignable)'

Expected Behavior

No compiler Error

Steps To Reproduce

See above

Link to public reproduction project repository

https://github.com/danielftz/BugExample.MCTMarkupTextAlignment

Environment

- .NET MAUI C# Markup CommunityToolkit:
- OS: MacOS
- .NET MAUI: Latest CUrrent

Anything else?

No response

Issue Analytics

  • State:closed
  • Created 7 months ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
pictoscommented, Feb 7, 2023

@danielftz Can you share a link with a sample project? Friendly reminder that we don’t accept zip files, just repos on GitHub or GitLab, more info here

It looks like we’re generating code for classes that extends from base types that already have code generated, I guess it’s the issue that I mentioned here. But we can just confirm with a reproduction sample

0reactions
Youssef1313commented, Apr 3, 2023

My assumption in the previous comment may be wrong.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript type inference issue with string literal
It seems that it is inferring the type of textAlign to be the too general string instead of checking the actual value (...
Read more >
When a QTable `columns` prop has the `align` set to `'left'` ...
When a QTable columns prop has the align set to 'left' or 'right' or 'center' it throws this TypeScript error: Type '({ name:...
Read more >
TextAlignment extensions - .NET MAUI Community Toolkit
The TextAlignment extensions provide a series of extension methods that support configuring the text alignment of controls implementing ...
Read more >
Compiler Error Message: BC30560: 'XtraReport' is ...
I'm stumped by the following error that I received when I moved a website t production. I have used the same code for...
Read more >
Align Center - OutSystems 11 Documentation
This example shows you how to center align a user's name and initials. In Service Studio, in the Toolbox, search for Align Center...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found