Skip to content

swift-api-digester: detect type to type alias change up-front to remove bogus diagnostics. #18811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions test/api-digester/source-stability.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// REQUIRES: OS=macosx
// RUN: %empty-directory(%t.tmp)
// mkdir %t.tmp/module-cache && mkdir %t.tmp/dummy.sdk
// RUN: %api-digester -dump-sdk -module Swift -o %t.tmp/current-stdlib.json -module-cache-path %t.tmp/module-cache -sdk %t.tmp/dummy.sdk -swift-version 3
// RUN: %api-digester -dump-sdk -module Swift -o %t.tmp/current-stdlib.json -module-cache-path %t.tmp/module-cache -sdk %t.tmp/dummy.sdk
// RUN: %api-digester -diagnose-sdk -input-paths %S/stdlib-stable.json -input-paths %t.tmp/current-stdlib.json >> %t.tmp/changes.txt
// RUN: %clang -E -P -x c %S/source-stability.swift.expected -o - | sed '/^\s*$/d' > %t.tmp/source-stability.swift.expected
// RUN: %clang -E -P -x c %t.tmp/changes.txt -o - | sed '/^\s*$/d' > %t.tmp/changes.txt.tmp
// RUN: diff -u %t.tmp/source-stability.swift.expected %t.tmp/changes.txt.tmp

// REQUIRES: rdar_43425867
94 changes: 81 additions & 13 deletions test/api-digester/source-stability.swift.expected
Original file line number Diff line number Diff line change
@@ -1,15 +1,83 @@
/* FIXME: Bogus */
TypeAlias DictionaryIterator.Element has been removed
TypeAlias SetIterator.Element has been removed
Var DictionaryIterator.customMirror has been removed
Var SetIterator.customMirror has been removed
Func DictionaryIterator.next() has been removed
Func SetIterator.next() has been removed

/* Renamed Decls (FIXME: Targets are Dictionary.Iterator & Set.Iterator) */
Struct DictionaryIterator has been renamed to Struct Iterator
Struct SetIterator has been renamed to Struct Iterator

/* FIXME: Bogus */

/* Generic Signature Changes */

/* RawRepresentable Changes */

/* Removed Decls */
TypeAlias AbsoluteValuable has been removed
TypeAlias BitwiseOperations has been removed (deprecated)
TypeAlias IntMax has been removed
TypeAlias Integer has been removed
TypeAlias IntegerArithmetic has been removed
TypeAlias SignedNumber has been removed
TypeAlias StringProtocol.UTF16Index has been removed (deprecated)
TypeAlias StringProtocol.UTF8Index has been removed (deprecated)
TypeAlias StringProtocol.UnicodeScalarIndex has been removed (deprecated)
TypeAlias UIntMax has been removed
Var FixedWidthInteger.allZeros has been removed (deprecated)
Constructor Int.init(truncatingBitPattern:) has been removed
Constructor Int16.init(truncatingBitPattern:) has been removed
Constructor Int32.init(truncatingBitPattern:) has been removed
Constructor Int8.init(truncatingBitPattern:) has been removed
Constructor String.init(_:obsoletedInSwift4:) has been removed
Constructor UInt.init(truncatingBitPattern:) has been removed
Constructor UInt16.init(truncatingBitPattern:) has been removed
Constructor UInt32.init(truncatingBitPattern:) has been removed
Constructor UInt8.init(truncatingBitPattern:) has been removed
Func BinaryInteger.toIntMax() has been removed
Func FixedWidthInteger.addWithOverflow(_:_:) has been removed
Func FixedWidthInteger.divideWithOverflow(_:_:) has been removed
Func FixedWidthInteger.multiplyWithOverflow(_:_:) has been removed
Func FixedWidthInteger.remainderWithOverflow(_:_:) has been removed
Func FixedWidthInteger.subtractWithOverflow(_:_:) has been removed
Func FloatingPoint.abs(_:) has been removed (deprecated)
Func FloatingPoint.add(_:) has been removed
Func FloatingPoint.adding(_:) has been removed
Func FloatingPoint.divide(by:) has been removed
Func FloatingPoint.divided(by:) has been removed
Func FloatingPoint.multiplied(by:) has been removed
Func FloatingPoint.multiply(by:) has been removed
Func FloatingPoint.negated() has been removed
Func FloatingPoint.subtract(_:) has been removed
Func FloatingPoint.subtracting(_:) has been removed
Func Int.toUIntMax() has been removed
Func Int16.toUIntMax() has been removed
Func Int32.toUIntMax() has been removed
Func Int64.toUIntMax() has been removed
Func Int8.toUIntMax() has been removed
Func Sequence.flatMap(_:) has been removed
Func SignedNumeric.abs(_:) has been removed
Func String.UTF16View.distance(from:to:) has been removed
Func String.UTF16View.index(_:offsetBy:) has been removed
Func String.UTF16View.index(after:) has been removed
Func String.UTF8View.distance(from:to:) has been removed
Func String.UTF8View.index(_:offsetBy:) has been removed
Func String.UTF8View.index(after:) has been removed
Func String.UnicodeScalarView.distance(from:to:) has been removed
Func String.UnicodeScalarView.index(_:offsetBy:) has been removed
Func String.UnicodeScalarView.index(after:) has been removed
Func String.UnicodeScalarView.popFirst() has been removed (deprecated)
Func String.popFirst() has been removed (deprecated)
Func UInt.toIntMax() has been removed
Func UInt16.toIntMax() has been removed
Func UInt32.toIntMax() has been removed
Func UInt64.toIntMax() has been removed
Func UInt8.toIntMax() has been removed
Func UnsignedInteger.toUIntMax() has been removed

/* Moved Decls */

/* Renamed Decls */
Func Dictionary.filter(_:obsoletedInSwift4:) has been renamed to Func Dictionary.filter(_:)
Func Set.filter(_:obsoletedInSwift4:) has been renamed to Func Set.filter(_:)

/* Type Changes */
Var Dictionary.keys has declared type change from LazyMapCollection<[Key : Value], Key> to Dictionary<Key, Value>.Keys
Var Dictionary.values has declared type change from LazyMapCollection<[Key : Value], Value> to Dictionary<Key, Value>.Values
Constructor String.init(_:) has return type change from String? to String
Func Dictionary.filter(_:obsoletedInSwift4:) has return type change from [Dictionary<Key, Value>.Element] to [Dictionary<Key, Value>.Key : Dictionary<Key, Value>.Value]
Func Dictionary.makeIterator() has return type change from DictionaryIterator<Dictionary<Key, Value>.Key, Dictionary<Key, Value>.Value> to Dictionary<Key, Value>.Iterator
Func Set.filter(_:obsoletedInSwift4:) has return type change from [Set<Element>.Element] to Set<Element>
Func Set.makeIterator() has return type change from SetIterator<Element> to Set<Element>.Iterator

/* Decl Attribute changes */
Loading