File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 2
2
//
3
3
// This source file is part of the Swift.org open source project
4
4
//
5
- // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
5
+ // Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
6
6
// Licensed under Apache License v2.0 with Runtime Library Exception
7
7
//
8
8
// See https://swift.org/LICENSE.txt for license information
@@ -1469,7 +1469,9 @@ class Verifier : public ASTWalker {
1469
1469
}
1470
1470
};
1471
1471
1472
- // These outer entities will be interleaved in multi-level optionals.
1472
+ // FIXME: This doesn't seem like a particularly robust
1473
+ // approach to tracking whether pointer conversions
1474
+ // always appear as call arguments.
1473
1475
while (true ) {
1474
1476
// Look through optional evaluations.
1475
1477
if (auto *optionalEval = dyn_cast<OptionalEvaluationExpr>(subExpr)) {
@@ -1484,6 +1486,17 @@ class Verifier : public ASTWalker {
1484
1486
continue ;
1485
1487
}
1486
1488
1489
+ // FIXME: This is only handling the value conversion, not
1490
+ // the key conversion. What this verifier check
1491
+ // should probably do is just track whether we're
1492
+ // currently visiting arguments of an apply when we
1493
+ // find these conversions.
1494
+ if (auto *upcast =
1495
+ dyn_cast<CollectionUpcastConversionExpr>(subExpr)) {
1496
+ subExpr = upcast->getValueConversion ().Conversion ;
1497
+ continue ;
1498
+ }
1499
+
1487
1500
break ;
1488
1501
}
1489
1502
Original file line number Diff line number Diff line change
1
+ // RUN: %target-typecheck-verify-swift
2
+
3
+ func foo( _ a: [ [ UInt8 ] ] , _ p: [ UnsafeRawPointer ] ) {
4
+ foo ( a, a) // expect-warning {{all paths through this function will call itself}}
5
+ }
You can’t perform that action at this time.
0 commit comments