Re: [swift-dev] [arc optimization] Why doesn't enum destructuring use guaranteed references?

2017-12-29 Thread Robert Widmann via swift-dev
Ran into this over the summer. My understanding is that Michael Gottesman (CC’d) has been looking into pattern matching at +0. The code in SILGenPattern needs to be reworked, but I found this problem intersects with the really old dynamic casting entry points in SILGen too which would seem to

Re: [swift-dev] [Questions][SE-143]Conditional conformances for protocols?

2017-12-06 Thread Robert Widmann via swift-dev
See Conditional Conformances via Protocol Extensions . > On Dec 6, 2017, at 11:05 AM, Cao, Jiannan via swift-dev > wrote: > > Recently, we can use conditional conformances for

Re: [swift-dev] Re-pitch: Deriving collections of enum cases

2017-11-10 Thread Robert Widmann via swift-dev
> On Nov 6, 2017, at 2:54 AM, Jacob Bandes-Storch via swift-dev > wrote: > > Over a year ago, we discussed adding a magic "allValues"/"allCases" static > property on enums with a compiler-derived implementation. The original > proposal PR ha

Re: [swift-dev] Looking for documentation/insight on .swiftdoc

2017-10-24 Thread Robert Widmann via swift-dev
Or libSyntax! ~Robert Widmann > On Oct 24, 2017, at 4:06 PM, Douglas Gregor via swift-dev > wrote: > > > >> On Oct 23, 2017, at 11:27 AM, George King via swift-dev >> wrote: >> >> Hello, I’m curious about the swiftdoc format. I’ve looked through the swift >> codebase and have been unable

Re: [swift-dev] Function overload resolution

2017-09-26 Thread Robert Widmann via swift-dev
> On Sep 25, 2017, at 10:01 AM, Nevin Brackett-Rozinsky > wrote: > > func triple(_ x: Int) -> Int { > return 3 * x > } > > extension Int { > func triple() -> Int { > return triple(self) // Error here > } > } > > > The error reads: > > Playground execution failed: > e

Re: [swift-dev] Function overload resolution

2017-09-24 Thread Robert Widmann via swift-dev
If either function had the correct signature and was being properly disambiguated there would not be a diagnostic popped. Can you provide an example of this? ~Robert Widmann > On Sep 24, 2017, at 8:58 PM, Nevin Brackett-Rozinsky > wrote: > > The new diagnostic is fine, the problem is that t

Re: [swift-dev] Function overload resolution

2017-09-24 Thread Robert Widmann via swift-dev
This appears to be resolved (in fact, I remember improving this some time ago). I get a much better diagnostic now > error: repl.swift:4:16: error: use of 'min' refers to instance method 'min()' > rather than global function 'min' in module 'Swift' > return min(1,2) >^ >

Re: [swift-dev] A constraint system / type variable question

2017-09-24 Thread Robert Widmann via swift-dev
vid Zarzycki wrote: > > Well, for starters, a function with zero arguments/parameters can be value > semantic. For example: > > func getMagicNumber() -> UInt64 { > return 0x3A4B1C7539DA4922 > } > > > Dave > >> On Sep 24, 2017, at 01:36, Robert Widman

Re: [swift-dev] A constraint system / type variable question

2017-09-23 Thread Robert Widmann via swift-dev
gt; FunctionTypes, one where the “hasValueSemantics” bit is set, and one where it > is not. If there is a better way to do this, I’m open. :-) > > Thanks, > Dave > > >> On Sep 23, 2017, at 20:11, Robert Widmann via swift-dev > <mailto:swift-dev@swift.o

Re: [swift-dev] A constraint system / type variable question

2017-09-23 Thread Robert Widmann via swift-dev
> On Sep 23, 2017, at 3:39 PM, David Zarzycki via swift-dev > wrote: > > Hello, > > I’m trying to replace the explicit FunctionType returned by > visitClosureExpr() in CSGen.cpp with a type variable; and ultimately a > disjunction of two FunctionTypes with different ExtInfo flags set (one >

Re: [swift-dev] Advice for implementing "literal values as generic types"

2017-08-30 Thread Robert Widmann via swift-dev
> On Aug 29, 2017, at 5:22 PM, David Sweeris via swift-dev > wrote: > > >> On Aug 29, 2017, at 1:49 PM, Slava Pestov > > wrote: >> >> >>> On Aug 29, 2017, at 11:03 AM, David Sweeris via swift-dev >>> mailto:swift-dev@swift.org>> wrote: >>> >>> Hi everyone! I'm try

Re: [swift-dev] [Performance Question]

2017-08-20 Thread Robert Widmann via swift-dev
> On Aug 19, 2017, at 10:50 PM, Félix Fischer via swift-dev > wrote: > > Hi all. > > I’m a CS student, and as such I’ve heard that the compiling process is very > hard, O(2^n) in the worst case (because of the type checker). I’m curious as > to how true this is. Is it truly EXP? Is there a s

Re: [swift-dev] Typos while hacking on the constraint system

2017-08-17 Thread Robert Widmann via swift-dev
It’s an unfortunate naming scheme, but I would hesitate to use notions like “from” and “to”, especially in CSSimplify where different matchers are handed types in whatever order variance requires. More critical here are the scoping issues. There are a bunch of places, especially in matchTypes

Re: [swift-dev] Debugging on Xcode

2017-08-11 Thread Robert Widmann via swift-dev
Full disclaimer: I haven’t looked into this bug, so I’m just going to describe higher-level workflow tips. > On Aug 11, 2017, at 5:02 AM, Mike Choi via swift-dev > wrote: > > Hello Swift community, > > I’m currently trying to debug SR-5556 > https://bugs.swift.org/plugins/servlet/mobile#issu

[swift-dev] [Discuss] Remove SwiftExperimental

2017-07-19 Thread Robert Widmann via swift-dev
Hello all, The SwiftExperimental library’s stated purpose is to be a place where experimental library features could be explored without fear of committing to a stable interface. At least, t

Re: [swift-dev] [Swift CI] Build Failure: 0. OSS - Swift Incremental RA - OS X (master) #10531

2017-06-04 Thread Robert Widmann via swift-dev
This one is my fault. Patch incoming. ~Robert Widmann 2017/06/04 13:51、no-re...@swift.org のメッセージ: > [FAILURE] oss-swift-incremental-RA-osx [#10531] > > Build URL:https://ci.swift.org/job/oss-swift-incremental-RA-osx/10531/ > Project: oss-swift-incremental-RA-osx > Date of build:

Re: [swift-dev] New warning message while switching on an enum

2017-05-09 Thread Robert Widmann via swift-dev
Is there a catch-all to query for such casts (sorry, I'm away from my computer at the moment). ~Robert Widmann 2017/05/09 16:40、Jordan Rose のメッセージ: > I think any bridging conversion or upcast would count. > > enum Foo { > case foo(NSFileManager) > case bar(NSString) > case baz(Int) > }

Re: [swift-dev] New warning message while switching on an enum

2017-05-09 Thread Robert Widmann via swift-dev
Right. I guess I should have asked: Are there any other kinds of patterns we consider exhaustive that have this structure? ~Robert Widmann > On May 9, 2017, at 2:23 PM, Jordan Rose wrote: > > "as NSError" isn't a tautology, though—the original type is 'Error'. > Additionally, the presence

Re: [swift-dev] New warning message while switching on an enum

2017-05-09 Thread Robert Widmann via swift-dev
We’ll warn if that kind of cast is a tautology, right? That leaves only the dynamic casts, which can’t be assumed exhaustive. ~Robert Widmann > On May 9, 2017, at 2:13 PM, Jordan Rose wrote: > > It's neither a variable binding nor an expression pattern, right? It has to > be compared against

Re: [swift-dev] New warning message while switching on an enum

2017-05-09 Thread Robert Widmann via swift-dev
It’s mine, yep. It looks like it’s classifying the cast in the first pattern as a variable binding instead of an expression pattern. I’ll push a fix later. Thanks! > On May 9, 2017, at 1:52 PM, Jordan Rose wrote: > > That looks like a bug to me, since of course the first pattern won't always

Re: [swift-dev] Duplicate characters in Swift repl within Xcode

2017-05-06 Thread Robert Widmann via swift-dev
Apparently this is a known issue with libedit-based CLIs. ~Robert Widmann > On May 7, 2017, at 12:46 AM, Halen Wooten via swift-dev > wrote: > > Hi, > > When I build and run swift through Xcode, the terminal duplicates my > input. For example, > > var x =

Re: [swift-dev] [Swift CI] Build Failure: 0. OSS - Swift Incremental RA - Ubuntu 14.04 (master) #2364

2017-04-30 Thread Robert Widmann via swift-dev
I’ve got this one. ~Robert Widmann > On Apr 30, 2017, at 8:48 PM, no-re...@swift.org wrote: > > [FAILURE] oss-swift-incremental-RA-linux-ubuntu-14_04 [#2364] > > Build URL: > https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-14_04/2364/ >

Re: [swift-dev] [Swift CI] Build Failure: OSS - Swift Package - Ubuntu 16.04 (master) #895

2017-04-30 Thread Robert Widmann via swift-dev
Looks like a build bot ran out of disk space! ~Robert Widmann > On Apr 30, 2017, at 6:59 PM, no-re...@swift.org wrote: > > [FAILURE] oss-swift-package-linux-ubuntu-16_04 [#895] > > Build URL: > https://ci.swift.org/job/oss-swift-package-linux-ubuntu-16_04/895/ >

Re: [swift-dev] [Swift CI] Build Still Failing: 1. OSS - Swift (Tools Opt+Assert, Stdlib Opt+DebInfo+Assert, Resilience) - macOS (master) #185

2017-04-30 Thread Robert Widmann via swift-dev
I can’t imagine the space engine had anything to do with that floating point test working again in resilient mode, but I’ll investigate. Thanks~ ~Robert Widmann > On Apr 30, 2017, at 5:55 PM, Mark Lacey wrote: > > Ben / Robert, I bisected the failures here and it looks like they are due to

Re: [swift-dev] [Swift CI] Build Failure: 0. OSS - Swift Incremental RA - Ubuntu 16.04 (master) #2577

2017-04-11 Thread Robert Widmann via swift-dev
I think this is out of Swift or Foundation’s control. It looks like the DTD servers were recently switched to https and libXML is not a fan. I can disable the test and file a radar. > On Apr 11, 2017, at 6:40 PM, Mishal Shah via swift-dev > wrote: > > Hi, > > We are seeing this test failu

Re: [swift-dev] Fixing complation condition processing

2017-03-13 Thread Robert Widmann via swift-dev
I think the source breakage here, if any in actual codebases, is minor enough that the patch could go through. ~Robert Widmann > On Mar 8, 2017, at 2:11 AM, rintaro ishizaki via swift-dev > wrote: > > Hi all, > > I'm fixing #if condition processing in this PR > https://github.com/apple/swif

Re: [swift-dev] [Swift CI] Build Failure: 0. OSS - Swift Incremental RA - Ubuntu 16.04 (master) #2138

2017-03-13 Thread Robert Widmann via swift-dev
This one is mine and will be resolved shortly. Practical Swift and I have been stepping on each others toes trying to introduce and fix the same crashes. ~Robert Widmann > On Mar 14, 2017, at 1:04 AM, no-re...@swift.org wrote: > > [FAILURE] oss-swift-incremental-RA-linux-ubuntu-16_04 [#2138] >

Re: [swift-dev] JIT-ting Swift

2017-03-06 Thread Robert Widmann via swift-dev
We used to have a callback in the standard library that would set the process arguments, but that approach was fragile and would still have broken here. Instead, we load the Swift standard library (a step we would have had to do anyway) before entering main and call out to platform-specific fun

Re: [swift-dev] JIT-ting Swift

2017-03-06 Thread Robert Widmann via swift-dev
%Sp is not an argument, it is the space necessary to hold a reference to the CommandLine enumeration's static argv member. When JIT'ing Swift, the value of argv doesn't matter because we replace the process' arguments dynamically https://github.com/apple/swift/blob/master/lib/Immediate/Immedi

Re: [swift-dev] Changes to LLDB Branch Management

2017-02-09 Thread Robert Widmann via swift-dev
Does this mean patches for LLDB-Swift will have to go through Phabricator instead of Github? ~Robert Widmann > On Feb 9, 2017, at 1:50 PM, Chris Bieneman via swift-dev > wrote: > > Hello Swift-Dev and Swift-LLDB-Dev, > > Over the last couple weeks we’ve been working on some changes to the br

Re: [swift-dev] Support for per-project code styles in SourceKit

2017-01-17 Thread Robert Widmann via swift-dev
My tweet was inflammatory, so excuse me (I was actually mad at Travis and vented about this instead). However, I think deeper integration with SourceKit formatting and Xcode would be beneficial, though I don’t know how much useful discussion about this can take place on the lists given that it’

Re: [swift-dev] CSGen/LinkedExprAnalyzer questions

2016-12-31 Thread Robert Widmann via swift-dev
> On Dec 31, 2016, at 2:47 PM, Jacob Bandes-Storch wrote: > > CS.getType(FVE) already gets rid of the optionality, so the > lookThrough/getAnyOptionalObjectType isn't necessary at all. Ah, sorry, quite right. > > I'm still not sure whether this is the right solution. Are there no other > e

Re: [swift-dev] CSGen/LinkedExprAnalyzer questions

2016-12-31 Thread Robert Widmann via swift-dev
Whoops, should only look through one level of optionality. You get the gist. ~Robert Widmann > On Dec 31, 2016, at 2:31 PM, Robert Widmann wrote: > > I taught LinkedExprAnalyzer about ForceValueExpr > > if (auto FVE = dyn_cast(expr)) { > > LTI.collectedTypes.insert(CS.getType(F

Re: [swift-dev] CSGen/LinkedExprAnalyzer questions

2016-12-31 Thread Robert Widmann via swift-dev
I taught LinkedExprAnalyzer about ForceValueExpr if (auto FVE = dyn_cast(expr)) { LTI.collectedTypes.insert(CS.getType(FVE)->lookThroughAllAnyOptionalTypes().getPointer()); return { false, expr }; } This seems to get it - didn’t check whether this regresses things, bu

Re: [swift-dev] New Contributor

2016-12-19 Thread Robert Widmann via swift-dev
Hello Zeyad, Thanks for your interest in contributing to Swift. I’ve left some pointers in the linked SR on how I would go about emitting this diagnostic. Cheers, ~Robert Widmann > On Dec 19, 2016, at 7:47 AM, Zeyad Salloum via swift-dev > wrote: > > Dear Swift Developers, > I’m working on

[swift-dev] [Pitch] Remove "Default will never be executed" Warning?

2016-11-26 Thread Robert Widmann via swift-dev
Hello all, I’ve seen and been a part of a number of conversations recently where talk of planning for “resilient enums”, or even just authors that ship frameworks that will eventually offer a binary option that export enum-based APIs. The consensus seems to be that the only safe way to deal wi

Re: [swift-dev] Associated type inference fun with RandomAccessCollection

2016-11-07 Thread Robert Widmann via swift-dev
Voting for 1. This is an ambiguity in stdlib through and through IMO. ~Robert Widmann 2016/11/07 22:07、Mark Lacey via swift-dev のメッセージ: > >> On Nov 7, 2016, at 6:16 PM, Douglas Gregor via swift-dev >> wrote: >> >> Hi all, >> >> While working on the type checker, I came across an interesti

[swift-dev] [SE-0075] Teaching Namebinding About IfConfig Resolution

2016-11-06 Thread Robert Widmann via swift-dev
Hello all, For context, I spent the weekend seeing what I could do about SE-0075 . From the last conversation I had with Jordan (which is summed up in the linked JIRA ticket pretty well), this kind of operation is currently very expensive and hence not as

Re: [swift-dev] Random() in the standard library

2016-07-03 Thread Robert Widmann via swift-dev
Trouble is, most modern languages disagree with that and have chosen to split them out of their standard libraries. - Rust https://github.com/rust-lang-nursery/rand - Go https://golang.org/pkg/math/rand/ - Dart https://api.dartlang.org/stable/1.17.1/dart-math/Random-class.html - Elm https://githu