Commit Graph

27 Commits

Author SHA1 Message Date
Anthony Latsis
2cd90bdd69 AST: Quote attributes more consistently in DiagnosticsSema.def 2025-04-22 18:23:36 +01:00
Hanna Yakusevych
c0ea9b2417 [SE-14761] Changed diagnostic for implicitly overridden init()
Provide more detailed diagnostic message when implicitly synthesized @objc initializer in subclass was overridden inside the subclass' extension

Resolves: rdar://problem/79179597
2021-07-14 02:10:35 +03:00
kaar3k@gmail.com
69a812333c [SR-14135]Updating diagnostic message for convenience init in struct 2021-05-05 19:57:53 +05:30
Robert Widmann
3790d5e277 [Gardening] overriden -> overridden 2021-02-08 11:22:57 -08:00
Minhyuk Kim
5c21cdf4a6 Modify override_decl_extension error to be more descriptive 2021-01-23 01:04:40 +09:00
Robert Widmann
5dc060ee57 Define ResolveTypeRequest 2020-04-30 16:10:25 -07:00
Varun Gandhi
a1716fe2a6 [Diagnostics] Update compiler diagnostics to use less jargon. (#31315)
Fixes rdar://problem/62375243.
2020-04-28 14:11:39 -07:00
Robert Widmann
a52fe65d96 Move a cycle 2019-10-17 16:01:56 -07:00
Slava Pestov
a260d0a445 AST: getInterfaceType() returns ErrorType instead of Type() on circularity 2019-10-08 01:37:09 -04:00
Slava Pestov
6828a12416 Sema: Remove unnecessary circularity breaks 2019-10-03 17:11:45 -04:00
Slava Pestov
ed3e4dc931 Sema: Add implicit constructors before checking members 2019-07-17 18:07:03 -04:00
Anthony Latsis
e229fbd25f Update basic_init.swift 2019-04-19 03:13:14 +03:00
fischertony
78f4b9dba9 Skip redecl errors for inits that conflict with an inherited init
This can only happen when the conflicting init is within an extension.
It is the override checker's responsibility to emit a sensible diagnostic here.
2019-04-18 22:04:29 +03:00
fischertony
a9fe0a6b9a Improve redeclaration error for implicit inits 2019-04-18 00:19:41 +03:00
Doug Gregor
17f42aa77a [Type checker] Stop using the iterative type checker for global typealiases.
The ITC is providing no benefit here; stop using it.
2018-06-14 15:29:57 -07:00
David Farler
b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00
Xi Ge
d43e5e37b6 [Fixit] Add a fixit to remove type alias self-referring declaration. (#3418)
* [Fixit] Add a fixit to remote type alias self-referring definition like typealias A = A. rdar://24869708

* [test] Update existing test.
2016-07-08 18:39:07 -07:00
Slava Pestov
3127264376 AST: When performing qualified lookup of a member type, filter out non-types earlier
With the previous resolveTypeInContext() patch, a few compiler
crashers regressed with this problem, presumably because we were now
performing lookups in more contexts than before.

This is a class of problems where we would attempt a recursive
validation:

1) Generic signature validation begins for type T
2) Name lookup in type context finds a non-type declaration D nested in T
3) Generic signature validation begins for D
4) The outer generic context of D is T, but T doesn't have a generic
   signature yet

The right way to break such cycles is to implement the iterative
decl checker design. However when the recursion is via name lookup,
we can try to avoid the problem in the first place by not validating
non-type declarations if the client requested a type-only lookup.

Note that there is a small semantic change here, where programs that
were previously rejected as invalid because of name clashes are
now valid. It is arguable if we want to allow stuff like this or not:

class A {
  func A(a: A) {}
}

or

class Case {}
enum Foo {
  case Case(Case)
}

However at the very least, the new behavior is better because it
gives us an opportunity to add a diagnostic in the right place
later. The old diagnostics were not very good, for example the
second example just yields "use of undeclared type 'Case'".
In other examples, the undeclared type diagnostic would come up
multiple times, or we would generate a cryptic "type 'A' used within
its own definition".

As far as I understand, this should not change behavior of any existing
valid code.
2016-06-11 16:27:43 -07:00
Doug Gregor
8c9be9be12 Iterative type checker: simple circular reference detection.
Put in some rudimentary logic for finding circular references within
the iterative type checker and diagnosing those cycles. The
"rudimentary" part is because we're performing linear searches within
a stack rather than keeping a proper dependency graph, which is
inefficient and could display longer cycles than are actually
present. Additionally, the diagnostic is not specialized to the actual
query, so we get a generic "circular reference" diagnostic. OTOH, we
show all of the declarations involved in the cycle, which at least
lets the user figure out where the cycle occurred.

Enable the iterative type checker for resolving the type of a global
typealiases.

Swift SVN r32572
2015-10-09 17:18:49 +00:00
Jordan Rose
a2ec27777e Don't crash when a property and a member type have the same name.
The exact message is mostly immaterial at this point, but without the
change we end up recursively validating the property, marking it invalid,
and then never actually emitting a diagnostic, leaving SILGen and
Serialization to go ahead and fail.

rdar://problem/20913392

Swift SVN r30830
2015-07-31 00:49:41 +00:00
Doug Gregor
54979b70a7 Remove uses of complete-unnamed function parameters from the testsuite.
Support for "func f(Int)" is going away.

Swift SVN r29608
2015-06-24 16:01:37 +00:00
Chris Lattner
3ad108b0be Reapply r29419:
Enhance fixItRemove() to be a bit more careful about what whitespace it leaves around: if the thing it is removing has leading and trailing whitespace already, this nukes an extra space to avoid leaving double spaces or incorrectly indented results.  

This includes an extra fix for looking off the start of a buffer, which extractText doesn't and can't handle.

This fixes <rdar://problem/21045509> Fixit deletes 'let' from non-binding 'if case let' statements, but leaves an extra space




Swift SVN r29449
2015-06-17 16:31:26 +00:00
Ted Kremenek
d13549e607 Revert "enhance fixItRemove() to be a bit more careful about what whitespace it leaves around:"
This was breaking the bots.

Swift SVN r29432
2015-06-17 02:20:52 +00:00
Chris Lattner
6b3167ab36 enhance fixItRemove() to be a bit more careful about what whitespace it leaves around:
if the thing it is removing has leading and trailing whitespace already, this nukes
an extra space to avoid leaving double spaces or incorrectly indented results.  This
fixes <rdar://problem/21045509> Fixit deletes 'let' from non-binding 'if case let' statements, but leaves an extra space



Swift SVN r29419
2015-06-17 00:55:59 +00:00
Chris Lattner
23b713abed fix typo in diagnostic.
Swift SVN r27873
2015-04-28 17:04:00 +00:00
Chris Lattner
88e50659f7 fix <rdar://problem/17564699> QoI: Structs should get convenience initializers
The diagnostic we were producing was confusing the user into thinking that
you couldn't have a delegating init on a struct.  Improve the diagnostic and
add a fixit hint.



Swift SVN r27872
2015-04-28 17:01:48 +00:00
Chris Lattner
08c8ab232b rename a testacse, NFC.
Swift SVN r27871
2015-04-28 16:34:24 +00:00