Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 238 - Generic use of member constraint solved to record field causes crash #434

Closed
wants to merge 2 commits into from

Conversation

dsyme
Copy link
Contributor

@dsyme dsyme commented May 9, 2015

Fix #238

We were missing a constraint assertion (to force the return type of a record solution to be equal to the return type in the static member constraint being solved)

@dsyme dsyme changed the title Fix 238 Fix 238 - Generic use of member constraint solved to record field causes crash May 11, 2015
@latkin
Copy link
Contributor

latkin commented May 18, 2015

👍

@latkin
Copy link
Contributor

latkin commented May 19, 2015

Thumbs-upped too soon. This doesn't consider setters for mutable record fields, which return unit.

Below previously worked, now fails.

type Foo = { mutable Y : int }
let inline setY (x:^T) (y:int) = (^T : (member set_Y : int -> unit) (x, y))
let x = { Y = 0 }

// error FS0001: The type 'unit' does not match the type 'int'
setY x 1

@dsyme
Copy link
Contributor Author

dsyme commented May 19, 2015

Thanks! Which test was that?

@latkin
Copy link
Contributor

latkin commented May 19, 2015

tests\fsharp\core\subtype\test.fsx

@dsyme
Copy link
Contributor Author

dsyme commented May 19, 2015

OK, fix now updated, should be good to go.

@dsyme dsyme closed this in 647787a May 20, 2015
@latkin latkin added the fixed label May 20, 2015
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.

None yet

3 participants