davedelong / DDMathParser

String → Number
MIT License
854 stars 153 forks source link

Fix hang in Xcode 9 beta 3 #140

Closed metabren closed 7 years ago

metabren commented 7 years ago

As per #139 – the compiler just gets confused differentiating between the various init methods.

davedelong commented 7 years ago

This isn't an appropriate fix. Changing the condition to be non-Optional means that most of the default rewrite rules will fail to construct.

metabren commented 7 years ago

Apologies. I thought I accounted for these cases with the extra constructor? I.e.

public init(predicate: String, template: String) takes care of all cases where there is no condition sent through.

I built and used this in my Xcode 9 project without issue.

No problems though ☺️

(and thanks so much for making this library!)

davedelong commented 7 years ago

oh, you're totally right!

metabren commented 7 years ago

I've actually been thinking about this today – and perhaps I was wrong, depending on how the rewrite rules are used.

If they're ever initialised with dynamic values (that may be nil), my change here means they'll need to check for nil before calling the appropriate constructor.

I don't really know enough about this library to make that call though!

Thanks for your time anyway 😁