[BUG] TextAlignment Extension Throwing Compiler Error
See original GitHub issueIs 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:
- Created 7 months ago
- Comments:11 (10 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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
My assumption in the previous comment may be wrong.