Re: [swift-dev] CSGen/LinkedExprAnalyzer questions

2016-12-31 Thread Jacob Bandes-Storch via swift-dev
On Sat, Dec 31, 2016 at 1:55 PM, Robert Widmann wrote: > > As for why this works with non-chained binops no simplification occurs in > that case because, well, there’s no chain here. The solver walks each part > in turn instead. > What do you mean by this? The LinkedExprAnalyzer is still used i

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 Jacob Bandes-Storch via swift-dev
CS.getType(FVE) already gets rid of the optionality, so the lookThrough/getAnyOptionalObjectType isn't necessary at all. I'm still not sure whether this is the right solution. Are there no other expression types that need similar treatment? Is ASTWalker really the right tool for this job? These ar

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] CSGen/LinkedExprAnalyzer questions

2016-12-31 Thread Mark Lacey via swift-dev
> On Dec 30, 2016, at 2:07 PM, Jacob Bandes-Storch via swift-dev > wrote: > > This is a pretty great bug: https://bugs.swift.org/browse/SR-3483 > > > let x: Double? = 1 > > // error: ambiguous reference to member '+' > let sum = x! + x! + x