multiple times, as well as teaching the name lookup mechanism that
it's similarly rude to report ambiguous results because it searched
the same import twice. Fixes <rdar://problem/11287213>.
Yes, this is a bit of an ugly hack.
Swift SVN r1610
forcing one to declare, e.g., [infix_left=NNN] on every
declaration. The precedence/associativity will be merged from any
similarly-named operator in translation unit scope or in an imported
module. Fixes <rdar://problem/11261874> very, very narrowly for the
demo.
This implementation is hacky and slow; we'll replace it later with
<rdar://problem/11304699>.
Swift SVN r1570
be lvalues (materializing them if necessary), as we do with subscript
expressions. Introduce a verifier for member expressions to make sure
this property holds.
Note that there is a slight regression in semantic analysis for
assignments to properties, because we no longer detect some cases of
writing into a property that should not be set. The general solution
to the problem is covered by <rdar://problem/11259972>.
Swift SVN r1530
- Ensure that the base is always an lvalue, materializing it if necessary
- Give appropriate lvalue qualifiers to the subscript expression
- Make sure to write the converted indices back into the AST
Finally, introduce a verifier for subscript expressions.
Swift SVN r1528
left-hand side is dependent, coerce the left-hand side to an lvalue of
the right-hand side's object type. This allows us to assign into
lvalues that may be overloaded on the underlying value type, e.g.,
subscripting values and overloaded variables. Fixes <rdar://problem/11285171>.
Swift SVN r1526
where overloading based on the indices is insufficient to select an
overload candidate. Implement type coercion for overloaded subscript
expressions, so that the context can help push overload resolution
along.
Swift SVN r1516
the appropriate slice type and check the bounds. The
first bound must be a literal or a type with a
getArrayBoundValue method, which has the same recursive
nature as getLogicValue (i.e. it can return a type that
has a getArrayBoundValue that returns an integral type,
but that's it; it's capped at one hop). The rest
of the bounds must be empty (meaning a slice) or
constant under the same conditions as fixed-size
array types.
Swift SVN r1501
binary operator for a given set of argument types. When the argument types
are not dependent or error types, include them in a short single error
diagnostic, and not separated in a separate note.
Swift SVN r1488
to the type named by A (when A is in fact a direct reference to a
type). If that coercion would fail, then fall back to invoking a
constructor. Fixes <rdar://problem/11272190>.
Swift SVN r1472
candidates both the elements of a oneof and any methods with the same
name as the oneof (which is our current hack for a constructor).
Given var x : Int, we can now write Double(x) rather than Double.Double(x).
Swift SVN r1469
element, add that element as a member lookup result but don't stop
there: also find extension functions with that same name.
Fixes <rdar://problem/11270370>.
Swift SVN r1468
generic over the type of the base. By "generic" I mean that it's
looked up by prepending the word "Slice" to the name of the base
type.
Swift SVN r1464
printing the operator, adjusting the diagnostic to point to the operator
and not the second operand, properly highlighting the ranges of the operands,
and printing out the types of the operands when appropriate.
Printing out the types is very useful when trying to understand the mismatch.
Note: I only partially know what I am doing at this stage. This feels a bit
kludgy, as the "cast<>"s reek of not enough implicit invariants being documented
in the ASTs themselves.
Fixes <rdar://problem/11266762>
Swift SVN r1449
member of an object. This expression kind is currently used to refer
to properties within an object, but will eventually be extended to
refer to fields as well (once we make StructDecl real).
Swift SVN r1445
PatternBindingDecl to the DeclContext. Do the same for the get/set
functions for a property, so we don't need to perform 'deep' setting
of the DeclContext. This is simpler, although it makes pretty-printing
the AST a bit more difficult.
Swift SVN r1428
struct/oneof/class extension, making them instance methods. Normal
variables are still not allowed in these contexts, however.
The fact that we set DeclContexts late causes some consternation here,
because it's not clear just how far we need to recurse in
DeclContext. I've done enough to make properties work, but I'm still
rather uneasy about the current state of affairs.
Swift SVN r1423