@@ -26,8 +26,46 @@ private module FullyQualifiedNameInput implements QualifiedNameInputSig {
26
26
*
27
27
* Either a modifiable (`Modifiable`) or an assignable (`Assignable`).
28
28
*/
29
- class Declaration extends DotNet:: Declaration , Element , @declaration {
30
- override ValueOrRefType getDeclaringType ( ) { none ( ) }
29
+ class Declaration extends NamedElement , @declaration {
30
+ /** Gets the name of this declaration, without additional decoration such as `<...>`. */
31
+ string getUndecoratedName ( ) { none ( ) }
32
+
33
+ /** Holds if this element has undecorated name 'name'. */
34
+ final predicate hasUndecoratedName ( string name ) { name = this .getUndecoratedName ( ) }
35
+
36
+ /**
37
+ * Gets the unbound version of this declaration, that is, the declaration where
38
+ * all type arguments have been removed. For example, in
39
+ *
40
+ * ```csharp
41
+ * class C<T>
42
+ * {
43
+ * class Nested
44
+ * {
45
+ * }
46
+ *
47
+ * void Method<S>() { }
48
+ * }
49
+ * ```
50
+ *
51
+ * we have the following
52
+ *
53
+ * | Declaration | Unbound declaration |
54
+ * |-------------------------|---------------------|
55
+ * | `C<int>` | ``C`1`` |
56
+ * | ``C`1.Nested`` | ``C`1.Nested`` |
57
+ * | `C<int>.Nested` | ``C`1.Nested`` |
58
+ * | ``C`1.Method`1`` | ``C`1.Method`1`` |
59
+ * | ``C<int>.Method`1`` | ``C`1.Method`1`` |
60
+ * | `C<int>.Method<string>` | ``C`1.Method`1`` |
61
+ */
62
+ Declaration getUnboundDeclaration ( ) { result = this }
63
+
64
+ /** Holds if this declaration is unbound. */
65
+ final predicate isUnboundDeclaration ( ) { this .getUnboundDeclaration ( ) = this }
66
+
67
+ /** Gets the type containing this declaration, if any. */
68
+ ValueOrRefType getDeclaringType ( ) { none ( ) }
31
69
32
70
/** Holds if this declaration is unconstructed and in source code. */
33
71
final predicate isSourceDeclaration ( ) { this .fromSource ( ) and this .isUnboundDeclaration ( ) }
@@ -222,33 +260,54 @@ class Modifiable extends Declaration, @modifiable {
222
260
}
223
261
224
262
/** A declaration that is a member of a type. */
225
- class Member extends DotNet :: Member , Modifiable , @member {
263
+ class Member extends Modifiable , @member {
226
264
/** Gets an access to this member. */
227
265
MemberAccess getAnAccess ( ) { result .getTarget ( ) = this }
228
266
267
+ /** Holds if this member is declared `public`. */
229
268
override predicate isPublic ( ) { Modifiable .super .isPublic ( ) }
230
269
270
+ /** Holds if this member is declared `protected.` */
231
271
override predicate isProtected ( ) { Modifiable .super .isProtected ( ) }
232
272
273
+ /** Holds if this member is `private`. */
233
274
override predicate isPrivate ( ) { Modifiable .super .isPrivate ( ) }
234
275
276
+ /** Holds if this member is `internal`. */
235
277
override predicate isInternal ( ) { Modifiable .super .isInternal ( ) }
236
278
279
+ /** Holds if this member is `sealed`. */
237
280
override predicate isSealed ( ) { Modifiable .super .isSealed ( ) }
238
281
282
+ /** Holds if this member is `abstract`. */
239
283
override predicate isAbstract ( ) { Modifiable .super .isAbstract ( ) }
240
284
285
+ /** Holds if this member is `static`. */
241
286
override predicate isStatic ( ) { Modifiable .super .isStatic ( ) }
242
287
288
+ /** Holds if this member is declared `required`. */
243
289
override predicate isRequired ( ) { Modifiable .super .isRequired ( ) }
244
290
291
+ /** Holds if this member is declared `file` local. */
245
292
override predicate isFile ( ) { Modifiable .super .isFile ( ) }
246
293
247
- deprecated final override predicate hasQualifiedName ( string namespace , string type , string name ) {
294
+ /**
295
+ * DEPRECATED: Use `hasFullyQualifiedName` instead.
296
+ *
297
+ * Holds if this member has name `name` and is defined in type `type`
298
+ * with namespace `namespace`.
299
+ */
300
+ cached
301
+ deprecated final predicate hasQualifiedName ( string namespace , string type , string name ) {
248
302
QualifiedName< QualifiedNameInput > :: hasQualifiedName ( this , namespace , type , name )
249
303
}
250
304
251
- final override predicate hasFullyQualifiedName ( string namespace , string type , string name ) {
305
+ /**
306
+ * Holds if this member has name `name` and is defined in type `type`
307
+ * with namespace `namespace`.
308
+ */
309
+ cached
310
+ final predicate hasFullyQualifiedName ( string namespace , string type , string name ) {
252
311
QualifiedName< FullyQualifiedNameInput > :: hasQualifiedName ( this , namespace , type , name )
253
312
}
254
313
}
0 commit comments