Thanks to the way we've set up our diagnostics engine, there's not actually
a reason for /everything/ to get rebuilt when /one/ diagnostic changes.
I've split them up into five categories for now: Parse, Sema, SIL, IRGen,
and Frontend, plus a set of "Common" diagnostics that are used in multiple
areas of the compiler. We can massage this later.
No functionality change, but should speed up compile times!
Swift SVN r12438
This attribute states that all stored properties within the class must
provide initial values. This will allow us to move stored property
initialization into Objective-C's post-allocation initialization hook,
.cxx_construct.
Swift SVN r12228
General compiler support is missing for 'type' properties on classes, and lets don't
work either, but at least we have a nice diagnostic now.
also, rename static -> type in a few internal diagnostic names.
Swift SVN r12102
- improve error recovery when rejecting lets with getters/setters.
- mark the 'self' parameter of an implicitly generator init() method
as 'let' when it is for a class.
Swift SVN r12098
Switch some diagnostic text from 'static' over to 'type' to make
things easier, and fix up some parsing issues with selector-style
declarations found by doing this. NFC
Swift SVN r12030
This allows them to appear in argument lists of functions, enabling behavior
like this:
func test_arguments(a : Int, var b : Int, let c : Int) {
a = 1 // ok (for now).
b = 2 // ok.
c = 3 // expected-error {{cannot assign to the result of this expression}}
}
Swift SVN r11746
typealias MyInt: ForwardIndex = Int
There is no real reason to allow this; it's just a static_assert that Int
conforms to ForwardIndex, which would be better spelled some other way.
This only applies to concrete typealiases, i.e. those that simply alias an
underlying type. Associated types can still have both inheritance clauses
and a (default) underlying type.
Swift SVN r11481
Derive the appropriate ExtraData for a SILFunctionType from its thinness and calling convention. Consider @!thin @cc(witness_method) as having ExtraData::Metatype. This should eliminate all of the unspoken gentleperson's agreements that let thin and witness functions survive IRGen currently when we can turn on SIL witness tables.
Swift SVN r11446
- Switch @mutable to be a tri-state attribute that is invertable with @!mutable.
- Move the semantic form of 'mutable' to being a bit on FuncDecl instead of
something in DeclAttrs. The former is a binary bit, the later is a tristate
which differentiates between "not present", "present and set" "present and inverted".
- Diagnose some invalid uses of @mutable, e.g. on class methods.
- Make setters default to mutable, and allow them to be switched with @!mutable.
Swift SVN r11439
arguments. Until we have @inout methods on structs, we can't mark anything
that can be address-exposed. This temporarily regresses a few testcases,
but they will come back later.
Swift SVN r11359
The parser shouldn't be diagnosing such semantic constraints. While
I'm here, allow definitions on functions in protocols (they're ignored
for now).
Swift SVN r11223
var decls. I was originally intending to use this for argument lists, but I
don't think that's a great direction to go anymore.
In any case, it seems uncontroversial to enforce immutability on foreach
enumation patterns, so I did that (see testcase)
Swift SVN r11124
are not settable (like get-only ones). Set the 'isLet' bit in various
places, but not the particularly interesting or useful places yet.
Swift SVN r11121
Have ArchetypeBuilder key the archetypes it produces by the abstract {depth,index} position of generic parameters rather than by the identity of particular GenericTypeParamDecls. Tighten the signature of AbstractTypeParamDecl-taking methods to only take GenericTypeParamDecls; that's the only case that comes up anymore. Introduce 'addGenericParameter' and 'getArchetype' overloads that work with GenericTypeParamTypes and DependentMemberTypes in addition to those that work with GenericTypeParamDecls.
Move ArchetypeBuilder.cpp from 'Sema' to 'AST' to correspond to its header's location.
When we parse something like 'protocol P { protocol Q {} }', eagerly give the erroneous nested protocol Q an ErrorType to suppress type-checking of the declaration. Otherwise, the nested implicit 'Self' parameters, which are fixed depth 0 index 0 in the generic parameter space, will collide in the ArchetypeBuilder.
Swift SVN r10966
This completes the FileUnit refactoring. A module consists of multiple
FileUnits, which provide decls from various file-like sources. I say
"file-like" because the Builtin module is implemented with a single
BuiltinUnit, and imported Clang modules are just a single FileUnit source
within a module.
Most modules, therefore, contain a single file unit; only the main module
will contain multiple source files (and eventually partial AST files).
The term "translation unit" has been scrubbed from the project. To refer
to the context of declarations outside of any other declarations, use
"top-level" or "module scope". To refer to a .swift file or its DeclContext,
use "source file". To refer to a single unit of compilation, use "module",
since the model is that an entire module will be compiled with a single
driver call. (It will still be possible to compile a single source file
through the direct-to-frontend interface, but only in the context of the
whole module.)
Swift SVN r10837