@@ -244,24 +244,24 @@ private TypeMention getExplicitTypeArgMention(Path path, TypeParam tp) {
244
244
}
245
245
246
246
/**
247
- * A matching configuration for resolving types of record expressions
247
+ * A matching configuration for resolving types of struct expressions
248
248
* like `Foo { bar = baz }`.
249
249
*/
250
250
private module StructExprMatchingInput implements MatchingInputSig {
251
251
private newtype TPos =
252
252
TFieldPos ( string name ) { exists ( any ( Declaration decl ) .getField ( name ) ) } or
253
- TRecordPos ( )
253
+ TStructPos ( )
254
254
255
255
class DeclarationPosition extends TPos {
256
256
string asFieldPos ( ) { this = TFieldPos ( result ) }
257
257
258
- predicate isRecordPos ( ) { this = TRecordPos ( ) }
258
+ predicate isStructPos ( ) { this = TStructPos ( ) }
259
259
260
260
string toString ( ) {
261
261
result = this .asFieldPos ( )
262
262
or
263
- this .isRecordPos ( ) and
264
- result = "(record )"
263
+ this .isStructPos ( ) and
264
+ result = "(struct )"
265
265
}
266
266
}
267
267
@@ -282,15 +282,15 @@ private module StructExprMatchingInput implements MatchingInputSig {
282
282
result = tp .resolveTypeAt ( path )
283
283
)
284
284
or
285
- // type parameter of the record itself
286
- dpos .isRecordPos ( ) and
285
+ // type parameter of the struct itself
286
+ dpos .isStructPos ( ) and
287
287
result = this .getTypeParameter ( _) and
288
288
path = TypePath:: singleton ( result )
289
289
}
290
290
}
291
291
292
- private class RecordStructDecl extends Declaration , Struct {
293
- RecordStructDecl ( ) { this .isRecord ( ) }
292
+ private class StructDecl extends Declaration , Struct {
293
+ StructDecl ( ) { this .isStruct ( ) }
294
294
295
295
override TypeParam getATypeParam ( ) { result = this .getGenericParamList ( ) .getATypeParam ( ) }
296
296
@@ -300,14 +300,14 @@ private module StructExprMatchingInput implements MatchingInputSig {
300
300
result = super .getDeclaredType ( dpos , path )
301
301
or
302
302
// type of the struct itself
303
- dpos .isRecordPos ( ) and
303
+ dpos .isStructPos ( ) and
304
304
path .isEmpty ( ) and
305
305
result = TStruct ( this )
306
306
}
307
307
}
308
308
309
- private class RecordVariantDecl extends Declaration , Variant {
310
- RecordVariantDecl ( ) { this .isRecord ( ) }
309
+ private class StructVariantDecl extends Declaration , Variant {
310
+ StructVariantDecl ( ) { this .isStruct ( ) }
311
311
312
312
Enum getEnum ( ) { result .getVariantList ( ) .getAVariant ( ) = this }
313
313
@@ -321,7 +321,7 @@ private module StructExprMatchingInput implements MatchingInputSig {
321
321
result = super .getDeclaredType ( dpos , path )
322
322
or
323
323
// type of the enum itself
324
- dpos .isRecordPos ( ) and
324
+ dpos .isStructPos ( ) and
325
325
path .isEmpty ( ) and
326
326
result = TEnum ( this .getEnum ( ) )
327
327
}
@@ -338,7 +338,7 @@ private module StructExprMatchingInput implements MatchingInputSig {
338
338
result = this .getFieldExpr ( apos .asFieldPos ( ) ) .getExpr ( )
339
339
or
340
340
result = this and
341
- apos .isRecordPos ( )
341
+ apos .isStructPos ( )
342
342
}
343
343
344
344
Type getInferredType ( AccessPosition apos , TypePath path ) {
@@ -356,8 +356,8 @@ private module StructExprMatchingInput implements MatchingInputSig {
356
356
private module StructExprMatching = Matching< StructExprMatchingInput > ;
357
357
358
358
/**
359
- * Gets the type of `n` at `path`, where `n` is either a record expression or
360
- * a field expression of a record expression.
359
+ * Gets the type of `n` at `path`, where `n` is either a struct expression or
360
+ * a field expression of a struct expression.
361
361
*/
362
362
pragma [ nomagic]
363
363
private Type inferStructExprType ( AstNode n , TypePath path ) {
@@ -773,7 +773,7 @@ private module FieldExprMatchingInput implements MatchingInputSig {
773
773
774
774
Declaration getTarget ( ) {
775
775
// mutual recursion; resolving fields requires resolving types and vice versa
776
- result = [ resolveRecordFieldExpr ( this ) .( AstNode ) , resolveTupleFieldExpr ( this ) ]
776
+ result = [ resolveStructFieldExpr ( this ) .( AstNode ) , resolveTupleFieldExpr ( this ) ]
777
777
}
778
778
}
779
779
@@ -917,10 +917,10 @@ private module Cached {
917
917
}
918
918
919
919
/**
920
- * Gets the record field that the field expression `fe` resolves to, if any.
920
+ * Gets the struct field that the field expression `fe` resolves to, if any.
921
921
*/
922
922
cached
923
- StructField resolveRecordFieldExpr ( FieldExpr fe ) {
923
+ StructField resolveStructFieldExpr ( FieldExpr fe ) {
924
924
exists ( string name | result = getFieldExprLookupType ( fe , name ) .getStructField ( name ) )
925
925
}
926
926
0 commit comments