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

XAMLIL NRE for Style Selector #2839

Closed
aguahombre opened this issue Aug 12, 2019 · 0 comments
Closed

XAMLIL NRE for Style Selector #2839

aguahombre opened this issue Aug 12, 2019 · 0 comments
Labels

Comments

@aguahombre
Copy link
Contributor

Using build 0.8.999-cibuild0003548-beta, I get a XAMLIL compiler NRE for the following XAML

<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:Class="AvaloniaApplication7.Views.ViewA">
  <UserControl.Styles>
    <Style Selector=".large">
      <Setter Property="Background" Value="White"/>
    </Style>
  </UserControl.Styles>
  <TextBlock Text="{Binding UrlPathSegment}" Classes="large"/>
</UserControl>
Error	XAMLIL	Internal compiler error while emitting node Avalonia.Markup.Xaml.XamlIl.CompilerExtensions.Transformers.XamlIlOrSelectorNode:
System.NullReferenceException: Object reference not set to an instance of an object.
   at XamlIl.TypeSystem.XamlIlTypeSystemExtensions.EmitCall(IXamlIlEmitter emitter, IXamlIlMethod method, Boolean swallowResult) in D:\a\1\s\src\Markup\Avalonia.Markup.Xaml\XamlIl\xamlil.github\src\XamlIl\TypeSystem\TypeSystem.cs:line 474
   at Avalonia.Markup.Xaml.XamlIl.CompilerExtensions.Transformers.XamlIlSelectorNode.EmitCall(XamlIlEmitContext context, IXamlIlEmitter codeGen, Func`2 method) in D:\a\1\s\src\Markup\Avalonia.Markup.Xaml\XamlIl\CompilerExtensions\Transformers\AvaloniaXamlIlSelectorTransformer.cs:line 164
   at Avalonia.Markup.Xaml.XamlIl.CompilerExtensions.Transformers.XamlIlOrSelectorNode.DoEmit(XamlIlEmitContext context, IXamlIlEmitter codeGen) in D:\a\1\s\src\Markup\Avalonia.Markup.Xaml\XamlIl\CompilerExtensions\Transformers\AvaloniaXamlIlSelectorTransformer.cs:line 334
   a... Line 9, position 6.	AvaloniaApplication7	

The compiler error goes away if I change the selector to TextBlock.large

@grokys grokys added the bug label Oct 28, 2019
@grokys grokys added this to To do in @grokys todos via automation Oct 28, 2019
@grokys grokys removed this from To do in @grokys todos Aug 6, 2020
@maxkatz6 maxkatz6 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants