Commit 102ddca 1 parent 00b6545 commit 102ddca Copy full SHA for 102ddca
File tree 1 file changed +27
-0
lines changed
ICSharpCode.Decompiler.Tests/TestCases/Correctness
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -27,9 +27,15 @@ static void Main()
27
27
AvoidLifting ( ) ;
28
28
BitNot ( ) ;
29
29
FieldAccessOrderOfEvaluation ( null ) ;
30
+ FieldAccessOrderOfEvaluationWithStruct ( null ) ;
30
31
ArrayAccessOrderOfEvaluation ( ) ;
31
32
}
32
33
34
+ struct SomeStruct
35
+ {
36
+ public int IntField ;
37
+ }
38
+
33
39
static void AvoidLifting ( )
34
40
{
35
41
Console . WriteLine ( "MayThrow:" ) ;
@@ -113,6 +119,27 @@ static void FieldAccessOrderOfEvaluation(NullableTests c)
113
119
}
114
120
}
115
121
122
+ SomeStruct structField ;
123
+
124
+ static void FieldAccessOrderOfEvaluationWithStruct ( NullableTests c )
125
+ {
126
+ Console . WriteLine ( "GetInt, then NRE (with struct):" ) ;
127
+ try {
128
+ c . structField . IntField = GetValue < int > ( ) ;
129
+ } catch ( Exception ex ) {
130
+ Console . WriteLine ( ex . Message ) ;
131
+ }
132
+ Console . WriteLine ( "NRE before GetInt (with struct):" ) ;
133
+ try {
134
+ #if CS60
135
+ ref SomeStruct s = ref c . structField ;
136
+ s . IntField = GetValue < int > ( ) ;
137
+ #endif
138
+ } catch ( Exception ex ) {
139
+ Console . WriteLine ( ex . Message ) ;
140
+ }
141
+ }
142
+
116
143
static T [ ] GetArray < T > ( )
117
144
{
118
145
Console . WriteLine ( "GetArray" ) ;
You can’t perform that action at this time.
0 commit comments