Skip to content

Conversation

@dsyme
Copy link
Contributor

@dsyme dsyme commented Jun 22, 2016

This implements RFC FS--1017. A niggling language issue reported by @drvink quite a long time ago.

Basically it allows statically resolved member constraints to include a type - rather than a type parameter - in the list of items by which the constraint can be solved.

     .. when (Ty or  ^Typar) : (static member ... :  ...) =

This both fixes a "hole" where soome types could be inferred and printed, but not written in signatures, and also increases the utility of the statically-resolved-type-parameter (SRTP) mechanism.

The implementation is very straight-forward.

@drvink
Copy link
Contributor

drvink commented Jun 22, 2016

RFC PR at fsharp/fslang-design#103.

let tys,tpenv = List.mapFold (TcTypeAndRecover cenv newOk CheckCxs ItemOccurence.UseInType env) tpenv synTypes
#endif
let tys = List.map mkTyparTy tps
//let tys = List.map mkTyparTy tps
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should be deleted.

@KevinRansom
Copy link
Contributor

other than commented out code looks fine to me.

@dsyme dsyme changed the title Fix https://github.com/Microsoft/visualfsharp/issues/392 Allow all inferrable SRTP constraints to be written in signatures Jun 29, 2016
@dsyme dsyme changed the title Allow all inferrable SRTP constraints to be written in signatures [RFC FS-1017] Allow all inferrable SRTP constraints to be written in signatures Jun 29, 2016
@dsyme
Copy link
Contributor Author

dsyme commented Jul 7, 2016

I've updated this PR with a fix for #1306

@dsyme
Copy link
Contributor Author

dsyme commented Jul 17, 2016

Transient AppVeyor failure (unrelated to PR). AppVeyor have changed their hardware recenty which may explain a change in test timings for non-deterministic tests. There is either a bug lurking or an unstable test

[00:40:44] 1) Error : FSharp.Core.Unittests.FSharp_Core.Microsoft_FSharp_Control.AsyncModule.Async.Choice specification test
[00:40:44] System.Exception : Falsifiable, after 43 tests (0 shrinks) (StdGen (15424488,296180491)):
[00:40:44] Original:
[00:40:44] ChoiceWorkflow
[00:40:44]   ([NoneResultAfter -8; NoneResultAfter 9; SomeResultAfter 2;
[00:40:44]     SomeResultAfter -18; ExceptionAfter 12; ExceptionAfter -8;
[00:40:44]     NoneRes
[00:40:44] ultAfter -15; NoneResultAfter 2],Some 8)
[00:40:44] with exception:
[00:40:44] NUnit.Framework.AssertionException:   Expected: 4000
[00:40:44]   But was:  6000

@dsyme dsyme merged commit a8b607c into dotnet:master Jul 21, 2016
21c-HK referenced this pull request in fsharp/fslang-design Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants