Skip to content

Commit 2911eb3

Browse files
committed
Swift: prototype implementation of type inference in QL
1 parent 8d0c5a3 commit 2911eb3

16 files changed

Lines changed: 3297 additions & 276 deletions

File tree

rust/ql/lib/codeql/rust/internal/typeinference/Type.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ class PtrConstType extends PtrType {
357357

358358
/**
359359
* A special pseudo type used to indicate that the actual type may have to be
360-
* inferred by propagating type information back into call arguments.
360+
* inferred by propagating type information top-down.
361361
*
362362
* For example, in
363363
*
@@ -374,8 +374,8 @@ class PtrConstType extends PtrType {
374374
* parameter of `Vec`.
375375
*
376376
* Unknown types are used to restrict when type information is allowed to flow
377-
* into call arguments (including method call receivers), in order to avoid
378-
* combinatorial explosions.
377+
* top-down (including method call receivers), in order to avoid combinatorial
378+
* explosions.
379379
*/
380380
class UnknownType extends Type, TUnknownType {
381381
override TypeParameter getPositionalTypeParameter(int i) { none() }

rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,6 @@ private module Input2Common {
219219
}
220220

221221
private module PreInput2 implements InputSig2<PreTypeMention> {
222-
PreTypeMention getABaseTypeMention(Type t) { none() }
223-
224222
PreTypeMention getATypeParameterConstraint(TypeParameter tp) {
225223
result = Input2Common::getATypeParameterConstraint(tp)
226224
}
@@ -245,8 +243,6 @@ private module PreInput2 implements InputSig2<PreTypeMention> {
245243
module PreM2 = Make2<PreTypeMention, PreInput2>;
246244

247245
private module Input2 implements InputSig2<TypeMention> {
248-
TypeMention getABaseTypeMention(Type t) { none() }
249-
250246
TypeMention getATypeParameterConstraint(TypeParameter tp) {
251247
result = Input2Common::getATypeParameterConstraint(tp)
252248
}

0 commit comments

Comments
 (0)