Skip to content

Commit

Permalink
reproduce: global using alias with value type
Browse files Browse the repository at this point in the history
  • Loading branch information
jolexxa committed Dec 17, 2024
1 parent c2c8136 commit 2e87b01
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public partial class TypeRegistry : Chickensoft.Introspection.ITypeRegistry {
[typeof(Chickensoft.Introspection.Generator.Tests.TestCases.ConcreteChildOne)] = new Chickensoft.Introspection.IdentifiableTypeMetadata("ConcreteChildOne", static (r) => r.Receive<Chickensoft.Introspection.Generator.Tests.TestCases.ConcreteChildOne>(), static () => System.Activator.CreateInstance<Chickensoft.Introspection.Generator.Tests.TestCases.ConcreteChildOne>(), new Chickensoft.Introspection.Generator.Tests.TestCases.ConcreteChildOne.MetatypeMetadata(), "concrete_child_one", 1),
[typeof(Chickensoft.Introspection.Generator.Tests.TestCases.ConcreteChildTwo)] = new Chickensoft.Introspection.IdentifiableTypeMetadata("ConcreteChildTwo", static (r) => r.Receive<Chickensoft.Introspection.Generator.Tests.TestCases.ConcreteChildTwo>(), static () => System.Activator.CreateInstance<Chickensoft.Introspection.Generator.Tests.TestCases.ConcreteChildTwo>(), new Chickensoft.Introspection.Generator.Tests.TestCases.ConcreteChildTwo.MetatypeMetadata(), "concrete_child_two", 1),
[typeof(Chickensoft.Introspection.Generator.Tests.TestCases.DerivedModel)] = new Chickensoft.Introspection.IntrospectiveTypeMetadata("DerivedModel", static (r) => r.Receive<Chickensoft.Introspection.Generator.Tests.TestCases.DerivedModel>(), static () => System.Activator.CreateInstance<Chickensoft.Introspection.Generator.Tests.TestCases.DerivedModel>(), new Chickensoft.Introspection.Generator.Tests.TestCases.DerivedModel.MetatypeMetadata(), 1),
[typeof(Chickensoft.Introspection.Generator.Tests.TestCases.ExampleStruct)] = new Chickensoft.Introspection.ConcreteTypeMetadata("ExampleStruct", static (r) => r.Receive<Chickensoft.Introspection.Generator.Tests.TestCases.ExampleStruct>(), static () => System.Activator.CreateInstance<Chickensoft.Introspection.Generator.Tests.TestCases.ExampleStruct>()),
[typeof(Chickensoft.Introspection.Generator.Tests.TestCases.GenericStruct<>)] = new Chickensoft.Introspection.TypeMetadata("GenericStruct<T>"),
[typeof(Chickensoft.Introspection.Generator.Tests.TestCases.InitArgsModel)] = new Chickensoft.Introspection.IdentifiableTypeMetadata("InitArgsModel", static (r) => r.Receive<Chickensoft.Introspection.Generator.Tests.TestCases.InitArgsModel>(), static () => System.Activator.CreateInstance<Chickensoft.Introspection.Generator.Tests.TestCases.InitArgsModel>(), new Chickensoft.Introspection.Generator.Tests.TestCases.InitArgsModel.MetatypeMetadata(), "init_args_model", 1),
[typeof(Chickensoft.Introspection.Generator.Tests.TestCases.JunkAttribute)] = new Chickensoft.Introspection.ConcreteTypeMetadata("JunkAttribute", static (r) => r.Receive<Chickensoft.Introspection.Generator.Tests.TestCases.JunkAttribute>(), static () => System.Activator.CreateInstance<Chickensoft.Introspection.Generator.Tests.TestCases.JunkAttribute>()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

<!-- Tracks generator performance when dotnet build /binaryLogger -->
<ReportAnalyzer>true</ReportAnalyzer>

<NoWarn>CA1010;NU1903</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand All @@ -38,6 +40,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../Chickensoft.Introspection.OutsideAssemblyForTests/Chickensoft.Introspection.OutsideAssemblyForTests.csproj" />
<ProjectReference Include="../Chickensoft.Introspection/Chickensoft.Introspection.csproj" />
<ProjectReference Include="../Chickensoft.Introspection.Generator/Chickensoft.Introspection.Generator.csproj" />
<ProjectReference Include="../Chickensoft.Introspection.Generator/Chickensoft.Introspection.Generator.csproj" PrivateAssets="all" OutputItemType="analyzer" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma warning disable IDE0005 // Using directive is unnecessary.
global using MyExampleStruct =
Chickensoft.Introspection.Generator.Tests.TestCases.ExampleStruct;
global using MyOutsideExampleStruct =
Chickensoft.Introspection.OutsideAssemblyForTests.ExampleStruct;
#pragma warning restore IDE0005 // Using directive is unnecessary.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Chickensoft.Introspection.Generator.Tests.TestCases;

public readonly record struct ExampleStruct;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Chickensoft.Introspection.OutsideAssemblyForTests;

public readonly record struct ExampleStruct;
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

<!-- Tracks generator performance when dotnet build /binaryLogger -->
<ReportAnalyzer>true</ReportAnalyzer>

<NoWarn>NU1903</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"sdk": {
"version": "7.0.404",
"version": "9.0.100",
"rollForward": "latestMinor"
},
"msbuild-sdks": {
"Godot.NET.Sdk": "4.2.2"
}
}
}

0 comments on commit 2e87b01

Please sign in to comment.