@@ -248,24 +248,24 @@ private TypeMention getExplicitTypeArgMention(Path path, TypeParam tp) {
248
248
}
249
249
250
250
/**
251
- * A matching configuration for resolving types of record expressions
251
+ * A matching configuration for resolving types of struct expressions
252
252
* like `Foo { bar = baz }`.
253
253
*/
254
254
private module StructExprMatchingInput implements MatchingInputSig {
255
255
private newtype TPos =
256
256
TFieldPos ( string name ) { exists ( any ( Declaration decl ) .getField ( name ) ) } or
257
- TRecordPos ( )
257
+ TStructPos ( )
258
258
259
259
class DeclarationPosition extends TPos {
260
260
string asFieldPos ( ) { this = TFieldPos ( result ) }
261
261
262
- predicate isRecordPos ( ) { this = TRecordPos ( ) }
262
+ predicate isStructPos ( ) { this = TStructPos ( ) }
263
263
264
264
string toString ( ) {
265
265
result = this .asFieldPos ( )
266
266
or
267
- this .isRecordPos ( ) and
268
- result = "(record )"
267
+ this .isStructPos ( ) and
268
+ result = "(struct )"
269
269
}
270
270
}
271
271
@@ -286,15 +286,15 @@ private module StructExprMatchingInput implements MatchingInputSig {
286
286
result = tp .resolveTypeAt ( path )
287
287
)
288
288
or
289
- // type parameter of the record itself
290
- dpos .isRecordPos ( ) and
289
+ // type parameter of the struct itself
290
+ dpos .isStructPos ( ) and
291
291
result = this .getTypeParameter ( _) and
292
292
path = TypePath:: singleton ( result )
293
293
}
294
294
}
295
295
296
- private class RecordStructDecl extends Declaration , Struct {
297
- RecordStructDecl ( ) { this .isRecord ( ) }
296
+ private class StructDecl extends Declaration , Struct {
297
+ StructDecl ( ) { this .isStruct ( ) }
298
298
299
299
override TypeParam getATypeParam ( ) { result = this .getGenericParamList ( ) .getATypeParam ( ) }
300
300
@@ -304,14 +304,14 @@ private module StructExprMatchingInput implements MatchingInputSig {
304
304
result = super .getDeclaredType ( dpos , path )
305
305
or
306
306
// type of the struct itself
307
- dpos .isRecordPos ( ) and
307
+ dpos .isStructPos ( ) and
308
308
path .isEmpty ( ) and
309
309
result = TStruct ( this )
310
310
}
311
311
}
312
312
313
- private class RecordVariantDecl extends Declaration , Variant {
314
- RecordVariantDecl ( ) { this .isRecord ( ) }
313
+ private class StructVariantDecl extends Declaration , Variant {
314
+ StructVariantDecl ( ) { this .isStruct ( ) }
315
315
316
316
Enum getEnum ( ) { result .getVariantList ( ) .getAVariant ( ) = this }
317
317
@@ -325,7 +325,7 @@ private module StructExprMatchingInput implements MatchingInputSig {
325
325
result = super .getDeclaredType ( dpos , path )
326
326
or
327
327
// type of the enum itself
328
- dpos .isRecordPos ( ) and
328
+ dpos .isStructPos ( ) and
329
329
path .isEmpty ( ) and
330
330
result = TEnum ( this .getEnum ( ) )
331
331
}
@@ -342,7 +342,7 @@ private module StructExprMatchingInput implements MatchingInputSig {
342
342
result = this .getFieldExpr ( apos .asFieldPos ( ) ) .getExpr ( )
343
343
or
344
344
result = this and
345
- apos .isRecordPos ( )
345
+ apos .isStructPos ( )
346
346
}
347
347
348
348
Type getInferredType ( AccessPosition apos , TypePath path ) {
@@ -360,8 +360,8 @@ private module StructExprMatchingInput implements MatchingInputSig {
360
360
private module StructExprMatching = Matching< StructExprMatchingInput > ;
361
361
362
362
/**
363
- * Gets the type of `n` at `path`, where `n` is either a record expression or
364
- * a field expression of a record expression.
363
+ * Gets the type of `n` at `path`, where `n` is either a struct expression or
364
+ * a field expression of a struct expression.
365
365
*/
366
366
pragma [ nomagic]
367
367
private Type inferStructExprType ( AstNode n , TypePath path ) {
@@ -777,7 +777,7 @@ private module FieldExprMatchingInput implements MatchingInputSig {
777
777
778
778
Declaration getTarget ( ) {
779
779
// mutual recursion; resolving fields requires resolving types and vice versa
780
- result = [ resolveRecordFieldExpr ( this ) .( AstNode ) , resolveTupleFieldExpr ( this ) ]
780
+ result = [ resolveStructFieldExpr ( this ) .( AstNode ) , resolveTupleFieldExpr ( this ) ]
781
781
}
782
782
}
783
783
@@ -921,10 +921,10 @@ private module Cached {
921
921
}
922
922
923
923
/**
924
- * Gets the record field that the field expression `fe` resolves to, if any.
924
+ * Gets the struct field that the field expression `fe` resolves to, if any.
925
925
*/
926
926
cached
927
- StructField resolveRecordFieldExpr ( FieldExpr fe ) {
927
+ StructField resolveStructFieldExpr ( FieldExpr fe ) {
928
928
exists ( string name | result = getFieldExprLookupType ( fe , name ) .getStructField ( name ) )
929
929
}
930
930
0 commit comments