Skip to content

Commit a114050

Browse files
committed
Ruby: document ConstantReadAccessAsRbiType class
1 parent 4844e4f commit a114050

File tree

1 file changed

+12
-6
lines changed
  • ruby/ql/lib/codeql/ruby/experimental

1 file changed

+12
-6
lines changed

ruby/ql/lib/codeql/ruby/experimental/Rbi.qll

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,18 @@ module Rbi {
2424
*/
2525
abstract class RbiType extends Expr { }
2626

27-
class ConstantReadAccessAsRbiType extends RbiType {
28-
ConstantReadAccessAsRbiType() {
29-
this instanceof ConstantReadAccess
30-
// TODO: should this class be more restrictive?
31-
}
32-
}
27+
/**
28+
* A `ConstantReadAccess` as an RBI type. This is typically a reference to a
29+
* class or a constant representing a type alias - for example, the read
30+
* accesses to `MyList1`, `Integer` and `MyList2` in:
31+
* ```rb
32+
* class MyList1; end
33+
* MyList2 = T.type_alias(MyList1)
34+
* sig { params(l: MyList2).returns(Integer) }
35+
* def len(l); end
36+
* ```
37+
*/
38+
class ConstantReadAccessAsRbiType extends RbiType, ConstantReadAccess { }
3339

3440
/** A method call where the receiver is `T`. */
3541
private class MethodCallAgainstT extends MethodCall {

0 commit comments

Comments
 (0)