Commit Graph

13 Commits

Author SHA1 Message Date
Andrew Trick
ff02652108 Move enums into AttrKind.h.
This reorganization allows adding attributes that refer to types.
I need this for a @_specialize attribute with a type list.

PrintOptions.h and other headers depend on these enums. But Attr.h
defines a lot of classes that almost never need to be included.
2016-02-26 21:10:22 -08:00
practicalswift
a3f857ca7b [gardening] Add "-*- C++ -*-" to header files currently missing it 2016-01-23 11:53:05 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Jordan Rose
6b12b9130e Disallow nesting 'self.init' or 'super.init' inside other expressions.
In addition to being confusing, it makes it harder to implement
'try? self.init(...)' properly. (Next commit!)

Swift SVN r31034
2015-08-05 22:17:41 +00:00
Chris Lattner
9ae1ff707c Add a new DisableStructuralChecks option to typeCheckExpr which allows CSDiag to
avoid emitting this diagnostics.  They are always irritating to it because they
are duplicative with whatever the actual type constraint problem is.  It also
interferes with there recursive structure of the problem.

Disabling them also allows us to shorten the black list of expr nodes that cannot
be handled in typeCheckIndependentSubExpression.



Swift SVN r30122
2015-07-11 22:28:40 +00:00
Chris Lattner
ddd6192094 Implement 3 prominent feature requests:
<rdar://problem/15975935> warning that you can use 'let' not 'var'
<rdar://problem/18876585> Compiler should warn me if I set a parameter as 'var' but never modify it
<rdar://problem/17224539> QoI: warn about unused variables

This uses a simple pass in MiscDiagnostics that walks the body of an
AbstractFunctionDecl.  This means that it doesn't warn about unused properties (etc),
but it captures a vast majority of the cases.

It also does not warn about unused parameters (as a policy decision) because it is too noisy,
there are a variety of other refinements that could be done as well, thoughts welcome.



Swift SVN r28412
2015-05-11 06:26:05 +00:00
Jordan Rose
8f520414b7 [Accessibility] A private class cannot contain public methods.
There's no meaningful way in which these methods are public, since they
can't be accessed through any value of the type

<rdar://problem/17647878>

Swift SVN r20224
2014-07-20 17:26:24 +00:00
Jordan Rose
faa0fc4e41 [Accessibility] Setter requirements must be public for public conformances.
That is, if a protocol specifies that a property or subscript is settable,
check the accessibility of the conforming type's setter.

Swift SVN r19714
2014-07-09 00:07:45 +00:00
Jordan Rose
d545ac1623 [Accessibility] @required initializers must be as accessible as the type.
Swift SVN r19383
2014-06-30 23:38:36 +00:00
Jordan Rose
890df62a16 Warn on recursive computed variable access within its own getter.
Part of <rdar://problem/14083624>

Swift SVN r12454
2014-01-17 02:58:22 +00:00
Anna Zaks
c8ed1954f2 Issue a warning when returned expression is on the next line after the return keyword.
We still want to allow line wrapping, so only issue the warning when the indentation of the expression and the return keyword is the same.

radar://11945406

Swift SVN r9984
2013-11-06 02:00:13 +00:00
Dmitri Hrybenko
25c0c1b3b0 Self-assignment diagnostic: pass 'const Expr' where possible
Swift SVN r9981
2013-11-06 00:44:54 +00:00
Dmitri Hrybenko
61c067fe5f Implement a check in Sema to find self-assignment
rdar://14151649 suggests that it should be a warning, but I don’t see a reason
why it should not be an error.  We have no legacy code that relies on this.


Swift SVN r9976
2013-11-05 23:43:54 +00:00