@@ -20,7 +20,7 @@ public partial class Test_SourceGenerators
20
20
public void Test_SourceGenerators_NestedTypesThatAreNotJustClasses ( )
21
21
{
22
22
// This test just needs to compile, mostly
23
- NestedStructType . NestedInterfaceType . MyViewModel model = new ( ) ;
23
+ NestedStructType . NestedInterfaceType . NestedRecord . MyViewModel model = new ( ) ;
24
24
25
25
Assert . IsNull ( model . Name ) ;
26
26
Assert . IsTrue ( model . TestCommand is IRelayCommand ) ;
@@ -30,16 +30,19 @@ public partial struct NestedStructType
30
30
{
31
31
public partial interface NestedInterfaceType
32
32
{
33
- [ ObservableRecipient ]
34
- public partial class MyViewModel : ObservableValidator
33
+ public partial record NestedRecord
35
34
{
36
- [ ObservableProperty ]
37
- [ Required ]
38
- private string ? name ;
39
-
40
- [ ICommand ]
41
- private void Test ( )
35
+ [ ObservableRecipient ]
36
+ public partial class MyViewModel : ObservableValidator
42
37
{
38
+ [ ObservableProperty ]
39
+ [ Required ]
40
+ private string ? name ;
41
+
42
+ [ ICommand ]
43
+ private void Test ( )
44
+ {
45
+ }
43
46
}
44
47
}
45
48
}
@@ -49,7 +52,7 @@ private void Test()
49
52
public void Test_SourceGenerators_NestedTypesThatAreNotJustClassesAndWithGenerics ( )
50
53
{
51
54
// This test just needs to compile, mostly
52
- NestedStructTypeWithGenerics < int , float > . NestedInterfaceType < string > . MyViewModel model = new ( ) ;
55
+ NestedStructTypeWithGenerics < int , float > . NestedInterfaceType < string > . NestedRecord < string > . MyViewModel model = new ( ) ;
53
56
54
57
Assert . IsNull ( model . Name ) ;
55
58
Assert . IsTrue ( model . TestCommand is IRelayCommand ) ;
@@ -60,15 +63,18 @@ public partial struct NestedStructTypeWithGenerics<T1, T2>
60
63
{
61
64
public partial interface NestedInterfaceType < TFoo >
62
65
{
63
- [ INotifyPropertyChanged ]
64
- public partial class MyViewModel
66
+ public partial record NestedRecord < TBar >
65
67
{
66
- [ ObservableProperty ]
67
- private string ? name ;
68
-
69
- [ ICommand ]
70
- private void Test ( )
68
+ [ INotifyPropertyChanged ]
69
+ public partial class MyViewModel
71
70
{
71
+ [ ObservableProperty ]
72
+ private string ? name ;
73
+
74
+ [ ICommand ]
75
+ private void Test ( )
76
+ {
77
+ }
72
78
}
73
79
}
74
80
}
0 commit comments