[swift-dev] Inconsistent trapping for Bit

2015-12-08 Thread Patrick Pijnappel via swift-dev
Swift.Bit traps for Bit.One.successor(), but not for Bit.One.advancedBy(1). The documentation suggest they should be equivalent. ___ swift-dev mailing list swift-dev@swift.org https://lists.swift.org/mailman/listinfo/swift-dev

[swift-dev] [stdlib] Replace `.Some(x)` and `.None` by `x` and `nil`, respectively

2015-12-12 Thread Patrick Pijnappel via swift-dev
The standard library already predominantly uses the latter form but still contains regular usages of the former. For consistency and reduced clutter I'd propose to use the latter form throughout. The SIL for both forms is identical. Also Optional takes precedence over any other nil literal converti

[swift-dev] isUniquelyReferenced issues

2016-03-31 Thread Patrick Pijnappel via swift-dev
In trying to implement a COW type, but I'm running into problems with isUniqueReferenced breaking in even fairly simple cases. For example (with -O) the code below prints "bar: false", commenting out the print in test() makes it print "bar: true", and removing the var parameter var foo: Foo and usi

Re: [swift-dev] isUniquelyReferenced issues

2016-03-31 Thread Patrick Pijnappel via swift-dev
27 AM, Joe Groff wrote: > > > On Mar 31, 2016, at 4:21 PM, Joe Groff via swift-dev < > swift-dev@swift.org> wrote: > > > >> > >> On Mar 31, 2016, at 3:58 PM, Patrick Pijnappel via swift-dev < > swift-dev@swift.org> wrote: > >> >

Re: [swift-dev] isUniquelyReferenced issues

2016-04-01 Thread Patrick Pijnappel via swift-dev
ift-dev < >> swift-dev@swift.org> wrote: >> > >> >> >> >> On Mar 31, 2016, at 3:58 PM, Patrick Pijnappel via swift-dev < >> swift-dev@swift.org> wrote: >> >> >> >> In trying to implement a COW type, but I'm running i

[swift-dev] Benchmarks build failure

2016-05-31 Thread Patrick Pijnappel via swift-dev
On master benchmark build seems to fail after regenerating the harness files, i.e.: $ ./benchmark/scripts/generate_harness/generate_harness.py $ ./utils/build-script -RB Builds swift fine but fails on building the benchmarks: + /usr/local/bin/cmake --build ~/Code/swift/build/Ninja-ReleaseAssert/

Re: [swift-dev] Endgame for Swift 3

2016-07-15 Thread Patrick Pijnappel via swift-dev
> > Isn't half of this done, or something? I seem to remember seeing code > about it, and I think there may even be a hidden switch to enable what is > there. The parsing code seems to be in place, toggled by the flag Context.LangOpts. EnableProtocolTypealiases: https://github.com/apple/swift/blo

[swift-dev] COW for non-mutating methods

2016-12-01 Thread Patrick Pijnappel via swift-dev
I'm implementing a COW big int type but am running into problems with non-mutating functions (e.g. the + operator). Simplified example code below shows AFAIK the default way to implement COW, but the non-mutating method doesn't identify the reference as unique (even with -O), resulting in a needles