mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Merge pull request #19582 from jketema/jketema/swift-type
Swift: Fix type string representation
This commit is contained in:
@@ -691,7 +691,9 @@ codeql::CurrentContextIsolationExpr ExprTranslator::translateCurrentContextIsola
|
|||||||
|
|
||||||
codeql::TypeValueExpr ExprTranslator::translateTypeValueExpr(const swift::TypeValueExpr& expr) {
|
codeql::TypeValueExpr ExprTranslator::translateTypeValueExpr(const swift::TypeValueExpr& expr) {
|
||||||
auto entry = createExprEntry(expr);
|
auto entry = createExprEntry(expr);
|
||||||
entry.type_repr = dispatcher.fetchLabel(expr.getParamTypeRepr());
|
if (expr.getParamTypeRepr() && expr.getParamType()) {
|
||||||
|
entry.type_repr = dispatcher.fetchLabel(expr.getParamTypeRepr(), expr.getParamType());
|
||||||
|
}
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
| type_value_exprs.swift:4:13:4:13 | TypeValueExpr | hasType: | yes | getTypeRepr: | type_value_exprs.swift:4:13:4:13 | (no string representation) |
|
| type_value_exprs.swift:4:13:4:13 | TypeValueExpr | hasType: | yes | getTypeRepr: | type_value_exprs.swift:4:13:4:13 | N |
|
||||||
| type_value_exprs.swift:5:13:5:13 | TypeValueExpr | hasType: | yes | getTypeRepr: | type_value_exprs.swift:5:13:5:13 | (no string representation) |
|
| type_value_exprs.swift:5:13:5:13 | TypeValueExpr | hasType: | yes | getTypeRepr: | type_value_exprs.swift:5:13:5:13 | N |
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
| cfg.swift:591:13:591:13 | missing type from TypeRepr | UnspecifiedElement |
|
|
||||||
| cfg.swift:595:13:595:13 | missing type from TypeRepr | UnspecifiedElement |
|
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
| cfg.swift:591:13:591:13 | missing type from TypeRepr |
|
|
||||||
| cfg.swift:595:13:595:13 | missing type from TypeRepr |
|
|
||||||
|
|||||||
@@ -3552,7 +3552,7 @@ cfg.swift:
|
|||||||
# 590| getGenericTypeParam(0): [GenericTypeParamDecl] N
|
# 590| getGenericTypeParam(0): [GenericTypeParamDecl] N
|
||||||
# 591| getMember(0): [PatternBindingDecl] var ... = ...
|
# 591| getMember(0): [PatternBindingDecl] var ... = ...
|
||||||
# 591| getInit(0): [TypeValueExpr] TypeValueExpr
|
# 591| getInit(0): [TypeValueExpr] TypeValueExpr
|
||||||
# 591| getTypeRepr(): (no string representation)
|
# 591| getTypeRepr(): [TypeRepr] N
|
||||||
# 591| getPattern(0): [NamedPattern] x
|
# 591| getPattern(0): [NamedPattern] x
|
||||||
# 591| getMember(1): [ConcreteVarDecl] x
|
# 591| getMember(1): [ConcreteVarDecl] x
|
||||||
# 591| Type = Int
|
# 591| Type = Int
|
||||||
@@ -3596,7 +3596,6 @@ cfg.swift:
|
|||||||
# 590| Type = ValueGenericsStruct<N>
|
# 590| Type = ValueGenericsStruct<N>
|
||||||
# 590| getBody(): [BraceStmt] { ... }
|
# 590| getBody(): [BraceStmt] { ... }
|
||||||
# 590| getElement(0): [ReturnStmt] return
|
# 590| getElement(0): [ReturnStmt] return
|
||||||
# 591| [UnspecifiedElement] missing type from TypeRepr
|
|
||||||
# 594| [NamedFunction] valueGenericsFn(_:)
|
# 594| [NamedFunction] valueGenericsFn(_:)
|
||||||
# 594| InterfaceType = <let N : Int> (ValueGenericsStruct<N>) -> ()
|
# 594| InterfaceType = <let N : Int> (ValueGenericsStruct<N>) -> ()
|
||||||
# 594| getGenericTypeParam(0): [GenericTypeParamDecl] N
|
# 594| getGenericTypeParam(0): [GenericTypeParamDecl] N
|
||||||
@@ -3607,7 +3606,7 @@ cfg.swift:
|
|||||||
# 595| Type = Int
|
# 595| Type = Int
|
||||||
# 595| getElement(0): [PatternBindingDecl] var ... = ...
|
# 595| getElement(0): [PatternBindingDecl] var ... = ...
|
||||||
# 595| getInit(0): [TypeValueExpr] TypeValueExpr
|
# 595| getInit(0): [TypeValueExpr] TypeValueExpr
|
||||||
# 595| getTypeRepr(): (no string representation)
|
# 595| getTypeRepr(): [TypeRepr] N
|
||||||
# 595| getPattern(0): [NamedPattern] x
|
# 595| getPattern(0): [NamedPattern] x
|
||||||
# 596| getElement(1): [CallExpr] call to print(_:separator:terminator:)
|
# 596| getElement(1): [CallExpr] call to print(_:separator:terminator:)
|
||||||
# 596| getFunction(): [DeclRefExpr] print(_:separator:terminator:)
|
# 596| getFunction(): [DeclRefExpr] print(_:separator:terminator:)
|
||||||
@@ -3624,7 +3623,6 @@ cfg.swift:
|
|||||||
# 597| getElement(2): [AssignExpr] ... = ...
|
# 597| getElement(2): [AssignExpr] ... = ...
|
||||||
# 597| getDest(): [DiscardAssignmentExpr] _
|
# 597| getDest(): [DiscardAssignmentExpr] _
|
||||||
# 597| getSource(): [DeclRefExpr] value
|
# 597| getSource(): [DeclRefExpr] value
|
||||||
# 595| [UnspecifiedElement] missing type from TypeRepr
|
|
||||||
declarations.swift:
|
declarations.swift:
|
||||||
# 1| [StructDecl] Foo
|
# 1| [StructDecl] Foo
|
||||||
# 2| getMember(0): [PatternBindingDecl] var ... = ...
|
# 2| getMember(0): [PatternBindingDecl] var ... = ...
|
||||||
|
|||||||
Reference in New Issue
Block a user