@@ -16,6 +16,7 @@ import (
1616 "google.golang.org/protobuf/internal/impl"
1717 "google.golang.org/protobuf/internal/protobuild"
1818 "google.golang.org/protobuf/proto"
19+ "google.golang.org/protobuf/runtime/protoimpl"
1920 "google.golang.org/protobuf/testing/protocmp"
2021
2122 lazytestpb "google.golang.org/protobuf/internal/testprotos/lazy"
@@ -70,43 +71,43 @@ func TestMessageSetLazy(t *testing.T) {
7071
7172 nh := roundtrip (t , h ).(* lazytestpb.Holder )
7273
73- if extensionIsInitialized (t , nh .GetData (), lazytestpb .E_Rabbit_MessageSetExtension . Field ) {
74+ if extensionIsInitialized (t , nh .GetData (), lazytestpb .E_Rabbit_MessageSetExtension ) {
7475 t .Errorf ("Extension unexpectedly initialized after Unmarshal" )
7576 }
7677
7778 proto .Size (nh )
78- if extensionIsInitialized (t , nh .GetData (), lazytestpb .E_Rabbit_MessageSetExtension . Field ) {
79+ if extensionIsInitialized (t , nh .GetData (), lazytestpb .E_Rabbit_MessageSetExtension ) {
7980 t .Errorf ("Extension unexpectedly initialized after Size" )
8081 }
8182
8283 proto .Marshal (nh )
83- if extensionIsInitialized (t , nh .GetData (), lazytestpb .E_Rabbit_MessageSetExtension . Field ) {
84+ if extensionIsInitialized (t , nh .GetData (), lazytestpb .E_Rabbit_MessageSetExtension ) {
8485 t .Errorf ("Extension unexpectedly initialized after Marshal" )
8586 }
8687
8788 if ! proto .HasExtension (nh .GetData (), lazytestpb .E_Rabbit_MessageSetExtension ) {
8889 t .Fatalf ("Can't get extension" )
8990 }
90- if extensionIsInitialized (t , nh .GetData (), lazytestpb .E_Rabbit_MessageSetExtension . Field ) {
91+ if extensionIsInitialized (t , nh .GetData (), lazytestpb .E_Rabbit_MessageSetExtension ) {
9192 t .Errorf ("Extension unexpectedly initialized after Has" )
9293 }
9394
9495 nh = roundtrip (t , nh ).(* lazytestpb.Holder )
95- if extensionIsInitialized (t , nh .GetData (), lazytestpb .E_Rabbit_MessageSetExtension . Field ) {
96+ if extensionIsInitialized (t , nh .GetData (), lazytestpb .E_Rabbit_MessageSetExtension ) {
9697 t .Errorf ("Extension unexpectedly initialized after Has" )
9798 }
9899
99100 if diff := cmp .Diff (h , nh , protocmp .Transform ()); diff != "" {
100101 t .Errorf ("Got %+v, want %+v, diff:\n %s" , nh , h , diff )
101102 }
102- if got , want := extensionIsInitialized (t , nh .GetData (), lazytestpb .E_Rabbit_MessageSetExtension . Field ), true ; got != want {
103+ if got , want := extensionIsInitialized (t , nh .GetData (), lazytestpb .E_Rabbit_MessageSetExtension ), true ; got != want {
103104 t .Errorf ("Extension unexpectedly initialized after Diff" )
104105 }
105106 int := proto .GetExtension (nh .GetData (), lazytestpb .E_Rabbit_MessageSetExtension ).(* lazytestpb.Rabbit )
106107 if int .GetName () != "Judy" {
107108 t .Errorf ("Extension value \" Judy\" not retained, got: %v" , int .GetName ())
108109 }
109- if got , want := extensionIsInitialized (t , nh .GetData (), lazytestpb .E_Rabbit_MessageSetExtension . Field ), true ; got != want {
110+ if got , want := extensionIsInitialized (t , nh .GetData (), lazytestpb .E_Rabbit_MessageSetExtension ), true ; got != want {
110111 t .Errorf ("Extension unexpectedly initialized after Get" )
111112 }
112113}
@@ -136,40 +137,40 @@ func TestExtensionLazy(t *testing.T) {
136137
137138 nt := roundtrip (t , tree ).(* lazytestpb.Tree )
138139
139- if extensionIsInitialized (t , nt , lazytestpb .E_Bat . Field ) {
140+ if extensionIsInitialized (t , nt , lazytestpb .E_Bat ) {
140141 t .Errorf ("Extension unexpectedly initialized after Unmarshal" )
141142 }
142143 proto .Size (nt )
143- if extensionIsInitialized (t , nt , lazytestpb .E_Bat . Field ) {
144+ if extensionIsInitialized (t , nt , lazytestpb .E_Bat ) {
144145 t .Errorf ("Extension unexpectedly initialized after Size" )
145146 }
146147
147148 gb , err := proto .Marshal (nt )
148149 if err != nil {
149150 t .Fatalf ("proto.Marshal(%+v) failed: %v" , nt , err )
150151 }
151- if extensionIsInitialized (t , nt , lazytestpb .E_Bat . Field ) {
152+ if extensionIsInitialized (t , nt , lazytestpb .E_Bat ) {
152153 t .Errorf ("Extension unexpectedly initialized after Marshal" )
153154 }
154155
155156 fox := proto .GetExtension (nt , lazytestpb .E_Bat ).(* lazytestpb.FlyingFox )
156157 if got , want := fox .GetSpecies (), spGH ; want != got {
157158 t .Errorf ("Extension's Speices field not retained, want: %v, got: %v" , want , got )
158159 }
159- if got , want := extensionIsInitialized (t , nt , lazytestpb .E_Bat . Field ), true ; got != want {
160+ if got , want := extensionIsInitialized (t , nt , lazytestpb .E_Bat ), true ; got != want {
160161 t .Errorf ("Extension unexpectedly initialized after Get" )
161162 }
162- if extensionIsInitialized (t , nt , lazytestpb .E_BatPup . Field ) {
163+ if extensionIsInitialized (t , nt , lazytestpb .E_BatPup ) {
163164 t .Errorf ("Extension unexpectedly initialized after Get" )
164165 }
165166 foxPup := proto .GetExtension (nt , lazytestpb .E_BatPup ).(* lazytestpb.FlyingFox )
166167 if got , want := foxPup .GetSpecies (), spP ; want != got {
167168 t .Errorf ("Extension's Speices field not retained, want: %v, got: %v" , want , got )
168169 }
169- if got , want := extensionIsInitialized (t , nt , lazytestpb .E_Bat . Field ), true ; got != want {
170+ if got , want := extensionIsInitialized (t , nt , lazytestpb .E_Bat ), true ; got != want {
170171 t .Errorf ("Extension unexpectedly initialized after Get" )
171172 }
172- if got , want := extensionIsInitialized (t , nt , lazytestpb .E_BatPup . Field ), true ; got != want {
173+ if got , want := extensionIsInitialized (t , nt , lazytestpb .E_BatPup ), true ; got != want {
173174 t .Errorf ("Extension unexpectedly initialized after Get" )
174175 }
175176
@@ -181,7 +182,7 @@ func TestExtensionLazy(t *testing.T) {
181182 if diff := cmp .Diff (tree , rt , protocmp .Transform ()); diff != "" {
182183 t .Errorf ("Got %+v, want %+v, diff:\n %s" , rt , tree , diff )
183184 }
184- if got , want := extensionIsInitialized (t , rt , lazytestpb .E_Bat . Field ), true ; got != want {
185+ if got , want := extensionIsInitialized (t , rt , lazytestpb .E_Bat ), true ; got != want {
185186 t .Errorf ("Extension unexpectedly initialized after Diff" )
186187 }
187188
@@ -208,27 +209,27 @@ func TestExtensionNestedScopeLazy(t *testing.T) {
208209
209210 nt := roundtrip (t , tree ).(* lazytestpb.Tree )
210211
211- if extensionIsInitialized (t , nt , lazytestpb .E_BatNest_Bat . Field ) {
212+ if extensionIsInitialized (t , nt , lazytestpb .E_BatNest_Bat ) {
212213 t .Errorf ("Extension unexpectedly initialized after Unmarshal" )
213214 }
214215 proto .Size (nt )
215- if extensionIsInitialized (t , nt , lazytestpb .E_BatNest_Bat . Field ) {
216+ if extensionIsInitialized (t , nt , lazytestpb .E_BatNest_Bat ) {
216217 t .Errorf ("Extension unexpectedly initialized after Size" )
217218 }
218219
219220 gb , err := proto .Marshal (nt )
220221 if err != nil {
221222 t .Fatalf ("proto.Marshal(%+v) failed: %v" , nt , err )
222223 }
223- if extensionIsInitialized (t , nt , lazytestpb .E_BatNest_Bat . Field ) {
224+ if extensionIsInitialized (t , nt , lazytestpb .E_BatNest_Bat ) {
224225 t .Errorf ("Extension unexpectedly initialized after Marshal" )
225226 }
226227
227228 fox := proto .GetExtension (nt , lazytestpb .E_BatNest_Bat ).(* lazytestpb.FlyingFox )
228229 if got , want := fox .GetSpecies (), spGH ; want != got {
229230 t .Errorf ("Extension's Speices field not retained, want: %v, got: %v" , want , got )
230231 }
231- if got , want := extensionIsInitialized (t , nt , lazytestpb .E_BatNest_Bat . Field ), true ; got != want {
232+ if got , want := extensionIsInitialized (t , nt , lazytestpb .E_BatNest_Bat ), true ; got != want {
232233 t .Errorf ("Extension unexpectedly initialized after Get" )
233234 }
234235
@@ -240,7 +241,7 @@ func TestExtensionNestedScopeLazy(t *testing.T) {
240241 if diff := cmp .Diff (tree , rt , protocmp .Transform ()); diff != "" {
241242 t .Errorf ("Got %+v, want %+v, diff:\n %s" , rt , tree , diff )
242243 }
243- if got , want := extensionIsInitialized (t , rt , lazytestpb .E_BatNest_Bat . Field ), true ; got != want {
244+ if got , want := extensionIsInitialized (t , rt , lazytestpb .E_BatNest_Bat ), true ; got != want {
244245 t .Errorf ("Extension unexpectedly initialized after Diff" )
245246 }
246247}
@@ -261,7 +262,7 @@ func TestExtensionRepeatedMessageLazy(t *testing.T) {
261262 }
262263 mr := roundtrip (t , m ).(* lazytestpb.Tree )
263264
264- if extensionIsInitialized (t , mr , lazytestpb .E_BatPosse . Field ) {
265+ if extensionIsInitialized (t , mr , lazytestpb .E_BatPosse ) {
265266 t .Errorf ("Extension unexpectedly initialized after Unmarshal" )
266267 }
267268
@@ -270,7 +271,7 @@ func TestExtensionRepeatedMessageLazy(t *testing.T) {
270271 t .Errorf ("Extension is not present after setting: got %v, want %v" , got , want )
271272 }
272273
273- if extensionIsInitialized (t , mrr , lazytestpb .E_BatPosse . Field ) {
274+ if extensionIsInitialized (t , mrr , lazytestpb .E_BatPosse ) {
274275 t .Errorf ("Extension unexpectedly initialized after Has" )
275276 }
276277
@@ -279,7 +280,7 @@ func TestExtensionRepeatedMessageLazy(t *testing.T) {
279280 if got , want := foxPosse [0 ].GetSpecies (), spLE ; got != want {
280281 t .Errorf ("Extension's Speices field, want: %v, got: %v" , want , got )
281282 }
282- if got , want := extensionIsInitialized (t , mrr , lazytestpb .E_BatPosse . Field ), true ; got != want {
283+ if got , want := extensionIsInitialized (t , mrr , lazytestpb .E_BatPosse ), true ; got != want {
283284 t .Errorf ("Extension unexpectedly initialized after Get" )
284285 }
285286
@@ -291,30 +292,30 @@ func TestExtensionRepeatedMessageLazy(t *testing.T) {
291292 }
292293 mr = roundtrip (t , m ).(* lazytestpb.Tree )
293294
294- if got , want := extensionIsInitialized (t , mr , lazytestpb .E_BatPosse . Field ), true ; got != want {
295+ if got , want := extensionIsInitialized (t , mr , lazytestpb .E_BatPosse ), true ; got != want {
295296 t .Errorf ("Extension unexpectedly initialized after Unmarshal" )
296297 }
297298
298299 if got , want := proto .HasExtension (mr , lazytestpb .E_BatPosse ), false ; got != want {
299300 t .Errorf ("Extension is not present after setting: got %v, want %v" , got , want )
300301 }
301- if got , want := extensionIsInitialized (t , mr , lazytestpb .E_BatPosse . Field ), true ; got != want {
302+ if got , want := extensionIsInitialized (t , mr , lazytestpb .E_BatPosse ), true ; got != want {
302303 t .Errorf ("Extension unexpectedly initialized after Has" )
303304 }
304305
305306 mrr = roundtrip (t , mr ).(* lazytestpb.Tree )
306307 if got , want := proto .HasExtension (mrr , lazytestpb .E_BatPosse ), false ; got != want {
307308 t .Errorf ("Extension is not present after setting: got %v, want %v" , got , want )
308309 }
309- if got , want := extensionIsInitialized (t , mrr , lazytestpb .E_BatPosse . Field ), true ; got != want {
310+ if got , want := extensionIsInitialized (t , mrr , lazytestpb .E_BatPosse ), true ; got != want {
310311 t .Errorf ("Extension unexpectedly initialized after Has" )
311312 }
312313
313314 foxPosse = proto .GetExtension (mrr , lazytestpb .E_BatPosse ).([]* lazytestpb.FlyingFox )
314315 if got , want := len (foxPosse ), 0 ; got != want {
315316 t .Errorf ("Extension field length, want: %v, got: %v" , want , got )
316317 }
317- if got , want := extensionIsInitialized (t , mrr , lazytestpb .E_BatPosse . Field ), true ; got != want {
318+ if got , want := extensionIsInitialized (t , mrr , lazytestpb .E_BatPosse ), true ; got != want {
318319 t .Errorf ("Extension unexpectedly initialized after Get" )
319320 }
320321}
@@ -332,22 +333,22 @@ func TestExtensionIntegerLazy(t *testing.T) {
332333 }
333334 mr := roundtrip (t , m ).(* lazytestpb.Tree )
334335
335- if got , want := extensionIsInitialized (t , mr , lazytestpb .E_IntegerBat . Field ), true ; got != want {
336+ if got , want := extensionIsInitialized (t , mr , lazytestpb .E_IntegerBat ), true ; got != want {
336337 t .Errorf ("Extension unexpectedly initialized after Unmarshal" )
337338 }
338339
339340 if got , want := proto .HasExtension (mr , lazytestpb .E_IntegerBat ), true ; got != want {
340341 t .Errorf ("Extension is not present after setting: got %v, want %v" , got , want )
341342 }
342- if got , want := extensionIsInitialized (t , mr , lazytestpb .E_IntegerBat . Field ), true ; got != want {
343+ if got , want := extensionIsInitialized (t , mr , lazytestpb .E_IntegerBat ), true ; got != want {
343344 t .Errorf ("Extension unexpectedly initialized after Has" )
344345 }
345346
346347 mr = roundtrip (t , m ).(* lazytestpb.Tree )
347348 if got , want := proto .GetExtension (mr , lazytestpb .E_IntegerBat ).(uint32 ), iBat ; got != want {
348349 t .Errorf ("Extension's integer field, want: %v, got: %v" , want , got )
349350 }
350- if got , want := extensionIsInitialized (t , mr , lazytestpb .E_IntegerBat . Field ), true ; got != want {
351+ if got , want := extensionIsInitialized (t , mr , lazytestpb .E_IntegerBat ), true ; got != want {
351352 t .Errorf ("Extension unexpectedly initialized after Get" )
352353 }
353354}
@@ -365,7 +366,7 @@ func TestExtensionBinaryLazy(t *testing.T) {
365366 }
366367 mr := roundtrip (t , m ).(* lazytestpb.Tree )
367368 // A binary extension is never kept lazy
368- if got , want := extensionIsInitialized (t , mr , lazytestpb .E_BinaryBat . Field ), true ; got != want {
369+ if got , want := extensionIsInitialized (t , mr , lazytestpb .E_BinaryBat ), true ; got != want {
369370 t .Errorf ("Extension unexpectedly initialized after Unmarshal" )
370371 }
371372 if got , want := proto .HasExtension (mr , lazytestpb .E_BinaryBat ), true ; got != want {
@@ -379,7 +380,7 @@ func TestExtensionBinaryLazy(t *testing.T) {
379380 t .Errorf ("Extension present after setting: got %v, want %v" , got , want )
380381 }
381382 mr = roundtrip (t , m ).(* lazytestpb.Tree )
382- if got , want := extensionIsInitialized (t , mr , lazytestpb .E_BinaryBat . Field ), true ; got != want {
383+ if got , want := extensionIsInitialized (t , mr , lazytestpb .E_BinaryBat ), true ; got != want {
383384 t .Errorf ("Extension unexpectedly initialized after Unmarshal" )
384385 }
385386 if got , want := proto .HasExtension (mr , lazytestpb .E_BinaryBat ), true ; got != want {
@@ -405,28 +406,28 @@ func TestExtensionGroupLazy(t *testing.T) {
405406 }
406407 mr := roundtrip (t , m ).(* lazytestpb.Tree )
407408
408- if extensionIsInitialized (t , mr , lazytestpb .E_Pipistrelle . Field ) {
409+ if extensionIsInitialized (t , mr , lazytestpb .E_Pipistrelle ) {
409410 t .Errorf ("Extension unexpectedly initialized after Unmarshal" )
410411 }
411412 if got , want := proto .HasExtension (mr , lazytestpb .E_Pipistrelle ), true ; got != want {
412413 t .Errorf ("Extension present after setting: got %v, want %v" , got , want )
413414 }
414- if extensionIsInitialized (t , mr , lazytestpb .E_Pipistrelle . Field ) {
415+ if extensionIsInitialized (t , mr , lazytestpb .E_Pipistrelle ) {
415416 t .Errorf ("Extension unexpectedly initialized after Has" )
416417 }
417418 mrr := roundtrip (t , mr ).(* lazytestpb.Tree )
418- if extensionIsInitialized (t , mrr , lazytestpb .E_Pipistrelle . Field ) {
419+ if extensionIsInitialized (t , mrr , lazytestpb .E_Pipistrelle ) {
419420 t .Errorf ("Extension unexpectedly initialized after Unmarshal" )
420421 }
421422 mrr = roundtrip (t , mr ).(* lazytestpb.Tree )
422- if extensionIsInitialized (t , mrr , lazytestpb .E_Pipistrelle . Field ) {
423+ if extensionIsInitialized (t , mrr , lazytestpb .E_Pipistrelle ) {
423424 t .Errorf ("Extension unexpectedly initialized after Unmarshal" )
424425 }
425426 pipistrelle := proto .GetExtension (mrr , lazytestpb .E_Pipistrelle ).(* lazytestpb.Pipistrelle )
426427 if got , want := pipistrelle .GetSpecies (), spF ; got != want {
427428 t .Errorf ("Extension's Speices field, want: %v, got: %v" , want , got )
428429 }
429- if got , want := extensionIsInitialized (t , mrr , lazytestpb .E_Pipistrelle . Field ), true ; got != want {
430+ if got , want := extensionIsInitialized (t , mrr , lazytestpb .E_Pipistrelle ), true ; got != want {
430431 t .Errorf ("Extension unexpectedly initialized after Get" )
431432 }
432433
@@ -438,29 +439,29 @@ func TestExtensionGroupLazy(t *testing.T) {
438439 }
439440 mr = roundtrip (t , m ).(* lazytestpb.Tree )
440441
441- if extensionIsInitialized (t , mr , lazytestpb .E_Pipistrelles . Field ) {
442+ if extensionIsInitialized (t , mr , lazytestpb .E_Pipistrelles ) {
442443 t .Errorf ("Extension unexpectedly initialized after Unmarshal" )
443444 }
444445 if got , want := proto .HasExtension (mr , lazytestpb .E_Pipistrelles ), true ; got != want {
445446 t .Errorf ("Extension present after setting: got %v, want %v" , got , want )
446447 }
447- if extensionIsInitialized (t , mr , lazytestpb .E_Pipistrelles . Field ) {
448+ if extensionIsInitialized (t , mr , lazytestpb .E_Pipistrelles ) {
448449 t .Errorf ("Extension unexpectedly initialized after Has" )
449450 }
450451 mr = roundtrip (t , m ).(* lazytestpb.Tree )
451452 mrr = roundtrip (t , mr ).(* lazytestpb.Tree )
452453 if got , want := proto .HasExtension (mrr , lazytestpb .E_Pipistrelles ), true ; got != want {
453454 t .Errorf ("Extension present after setting: got %v, want %v" , got , want )
454455 }
455- if extensionIsInitialized (t , mrr , lazytestpb .E_Pipistrelles . Field ) {
456+ if extensionIsInitialized (t , mrr , lazytestpb .E_Pipistrelles ) {
456457 t .Errorf ("Extension unexpectedly initialized after Has" )
457458 }
458459 mrr = roundtrip (t , mr ).(* lazytestpb.Tree )
459460 pipistrelles := proto .GetExtension (mrr , lazytestpb .E_Pipistrelles ).([]* lazytestpb.Pipistrelles )
460461 if got , want := pipistrelles [1 ].GetSpecies (), spR ; got != want {
461462 t .Errorf ("Extension's Speices field, want: %v, got: %v" , want , got )
462463 }
463- if got , want := extensionIsInitialized (t , mrr , lazytestpb .E_Pipistrelles . Field ), true ; got != want {
464+ if got , want := extensionIsInitialized (t , mrr , lazytestpb .E_Pipistrelles ), true ; got != want {
464465 t .Errorf ("Extension unexpectedly initialized after Get" )
465466 }
466467
@@ -472,27 +473,27 @@ func TestExtensionGroupLazy(t *testing.T) {
472473 }
473474 mr = roundtrip (t , m ).(* lazytestpb.Tree )
474475
475- if got , want := extensionIsInitialized (t , mr , lazytestpb .E_Pipistrelles . Field ), true ; got != want {
476+ if got , want := extensionIsInitialized (t , mr , lazytestpb .E_Pipistrelles ), true ; got != want {
476477 t .Errorf ("Extension unexpectedly initialized after Unmarshal" )
477478 }
478479 if got , want := proto .HasExtension (mr , lazytestpb .E_Pipistrelles ), false ; got != want {
479480 t .Errorf ("Extension present after setting: got %v, want %v" , got , want )
480481 }
481- if got , want := extensionIsInitialized (t , mr , lazytestpb .E_Pipistrelles . Field ), true ; got != want {
482+ if got , want := extensionIsInitialized (t , mr , lazytestpb .E_Pipistrelles ), true ; got != want {
482483 t .Errorf ("Extension unexpectedly initialized after Has" )
483484 }
484485 mrr = roundtrip (t , mr ).(* lazytestpb.Tree )
485486 if got , want := proto .HasExtension (mrr , lazytestpb .E_Pipistrelles ), false ; got != want {
486487 t .Errorf ("Extension present after setting: got %v, want %v" , got , want )
487488 }
488- if got , want := extensionIsInitialized (t , mrr , lazytestpb .E_Pipistrelles . Field ), true ; got != want {
489+ if got , want := extensionIsInitialized (t , mrr , lazytestpb .E_Pipistrelles ), true ; got != want {
489490 t .Errorf ("Extension unexpectedly initialized after Has" )
490491 }
491492 noPipistrelles := proto .GetExtension (mrr , lazytestpb .E_Pipistrelles ).([]* lazytestpb.Pipistrelles )
492493 if got , want := len (noPipistrelles ), 0 ; got != want {
493494 t .Errorf ("Extension's field length, want: %v, got: %v" , want , got )
494495 }
495- if got , want := extensionIsInitialized (t , mrr , lazytestpb .E_Pipistrelles . Field ), true ; got != want {
496+ if got , want := extensionIsInitialized (t , mrr , lazytestpb .E_Pipistrelles ), true ; got != want {
496497 t .Errorf ("Extension unexpectedly initialized after Get" )
497498 }
498499}
@@ -581,7 +582,7 @@ func (p pointer) AsValueOf(t reflect.Type) reflect.Value {
581582
582583// Highly implementation dependent - uses unsafe pointers to figure
583584// out if the lazyExtensionValue is initialized.
584- func extensionIsInitialized (t * testing.T , data any , fieldNo int32 ) bool {
585+ func extensionIsInitialized (t * testing.T , data any , ei * protoimpl. ExtensionInfo ) bool {
585586 ext , ok := reflect .TypeOf (data ).Elem ().FieldByName ("extensionFields" )
586587 if ! ok {
587588 t .Fatalf ("Failed to retrieve offset of field \" extensionFields\" ." )
@@ -596,7 +597,7 @@ func extensionIsInitialized(t *testing.T, data any, fieldNo int32) bool {
596597 if ! ok {
597598 t .Fatalf ("Extension map has unexpected type." )
598599 }
599- f := (* m )[fieldNo ]
600+ f := (* m )[int32 ( ei . TypeDescriptor (). Number ()) ]
600601 // Here we rely on atomicOnce being the first field in the 'lazy' struct.
601602 app , ok := pointerOfIface (& f ).Apply (lazy .Offset ).AsValueOf (reflect .TypeOf ((* uint32 )(nil ))).Interface ().(* * uint32 )
602603 if ! ok {
0 commit comments