Commit Graph

11 Commits

Author SHA1 Message Date
Henrik G. Olsson
cbc0ec3b88 Add -verify-ignore-unrelated where necessary (NFC)
These are tests that fail in the next commit without this flag. This
does not add -verify-ignore-unrelated to all tests with -verify, only
the ones that would fail without it. This is NFC since this flag is
currently a no-op.
2025-10-04 14:19:52 -07:00
Becca Royal-Gordon
4fa774d839 Allow ObjC superclass to disable init inheritance
ObjC classes which have only factory and convenience initializers cannot allow their convenience inits to be inherited. To provide these classes with a reliable opt-out, tweak support for @_hasMissingDesignatedInitializers so that it affects ObjC classes even if they’re in the same module as one another.

Fixes rdar://48511013.
2022-11-02 17:12:53 -07:00
Hamish Knight
f99b7592bf [test] Add test case for convenience init inheritance
This test case tripped up an attempt I made to
simplify addImplicitInheritedConstructorsToClass
for clang decls. Add it to the test suite to make
sure we don't regress it.
2019-10-25 09:19:45 -07:00
Pavel Yaskevich
a1643d94f7 [Diagnostics] NFC: Update all of the improved test-cases 2019-09-13 22:35:52 -07:00
Jordan Rose
a19cf7b183 Allow designated initializers outside the ClassDecl
Objective-C allows this in "class extensions" (nameless categories);
what's worse is that it's actually useful-ish sometimes: when you want
to put a particular initializer in an explicit submodule, or only
expose it to the current target.

rdar://problem/37173549
2018-03-19 16:36:40 -07:00
Jordan Rose
96fe8ef9dc [test] Limit the macOS-specific parts of objc_init.swift (#12313)
...rather than using a blanket "REQUIRES: OS=macosx".

This isn't really even macOS-specific, but having to keep availability
information up to date in a fake version of AppKit for non-macOS
platforms seems silly.

rdar://problem/19452886
2017-10-06 13:46:25 -07:00
Jordan Rose
14b979c035 [test] Remove -verify-ignore-unknown from tests that no longer need it. (#8547) 2017-04-05 09:23:05 -07:00
Rintaro Ishizaki
384ab780e9 [Diagnostic verifier] Make '<unknown>' check optional
Added frontend option '-verify-ignore-unknown'
2017-02-02 10:49:32 +09:00
Rintaro Ishizaki
827c6e7c3d [Diagnostic verifier] Diagnostics at '<unknown>:0' are unexpected 2017-02-02 10:48:54 +09:00
Michael Ilseman
d1efc80b1f [Import Decl] Don’t import as init using omit needless words
Previously, for an Objective-C class method declaration that could be
imported as init, we were making 4 decls:

1) The Swift 2 init
2) The Swift 2 class method decl (suppressing init formation)
3) The Swift 3 init (omitting needless words)
4) The Swift 3 class method decl (suppressing init formation and
   omitting needless words)

Decls 1), 2), and 4) exist for diagnostics and redirect the user at
3). But, 4) does not correspond to any actual Swift version name and
producing it correctly would require the user to understand how
omit-needless-words and other importer magic operates. It provides
very limited value and more importantly gets in the way of future
Clang importer refactoring. We’d like to turn Decl importing into
something that is simpler and language-version parameterized, but
there is no real Swift version to correspond to decl 4).

Therefore we will be making the following decls:

1) The "raw" decl, the name as it would appear to the user if they
   copy-pasted Objective-C code
2) The name as it appeared in Swift 2 (which could be an init)
3) The name as it appeared in Swift 3 (which could be an init and omit
   needless words)

This aligns with the language versions we want to import as in the
future: raw, swift2, swift3, …, and current.

Note that swift-ide-test prunes decls that are unavailable in the
current Swift version, so the Swift 2 non-init decls are not printed
out, though they are still present. Tests were updated and expanded to
ensure this was still the case.
2016-12-01 18:50:40 -08:00
Jordan Rose
61798ff6ec [test] Rename test/ClangModules to test/ClangImporter. (#5618)
...to match the component in include/ and lib/. No content change.
2016-11-02 18:00:53 -07:00