Skip to content

Fix 3016: Decode syntactic types using FSharpFunc, Tuple, ValueTuple #3283

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

Merged
merged 4 commits into from
Jul 6, 2017

Conversation

dsyme
Copy link
Contributor

@dsyme dsyme commented Jun 29, 2017

Tentative fix for #3016

Basically if the user code contains System.ValueTuple<int,int> then we treat that exactly as if struct (int * int) has been written. The compiler uses this form until emit. We were already doing this for types coming from C# assemblies but not for types written in F# code. We apply to FSharpFunc, Tuple and ValueTuple

@dsyme dsyme changed the title Decode syntactic types using FSharpFunc, Tuple, ValueTuple Fix 3016: Decode syntactic types using FSharpFunc, Tuple, ValueTuple Jun 29, 2017
@dsyme
Copy link
Contributor Author

dsyme commented Jun 29, 2017

Errors that need fixing:

1) Failed : FSharp-Tests-Core+TypecheckTests.sigs pos27
Error running command 'D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\..\..\release\net40\bin\fsc.exe' with args '-r:System.Core.dll --nowarn:20 --define:COMPILED --target:exe -o:pos27.exe pos27.fs' in directory 'D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs'. ERRORLEVEL 1
at TestFramework.checkResult(CmdResult result) in D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\test-framework.fs:line 259
at TestFramework.exec@438-22.Invoke(CmdResult result) in D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\test-framework.fs:line 438
at TestFramework.fsc@446-1.Invoke(String flags, FSharpList`1 srcFiles) in D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\test-framework.fs:line 446
at FSharp-Tests-Core.TypecheckTests.sigs pos27() in D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\tests.fs:line 1678

2) Error : FSharp-Tests-Core+TypecheckTests.type check neg23
System.Exception : neg23.err neg23.bsl differ; "diff between [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.bsl] and [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.err]
line 2
 - neg23.fs(9,21,9,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure1.SomeClass' once tuples, functions, units of measure and/or provided types are erased.
 + neg23.fs(9,21,9,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure1.SomeClass'.
diff between [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.bsl] and [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.err]
line 4
 - neg23.fs(7,21,7,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure1.SomeClass' once tuples, functions, units of measure and/or provided types are erased.
 + neg23.fs(7,21,7,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure1.SomeClass'.
diff between [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.bsl] and [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.err]
line 6
 - neg23.fs(19,21,19,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure2.SomeClass' once tuples, functions, units of measure and/or provided types are erased.
 + neg23.fs(19,21,19,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure2.SomeClass'.
diff between [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.bsl] and [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.err]
line 8
 - neg23.fs(17,21,17,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure2.SomeClass' once tuples, functions, units of measure and/or provided types are erased.
 + neg23.fs(17,21,17,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure2.SomeClass'.
diff between [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.bsl] and [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.err]
line 10
 - neg23.fs(28,21,28,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure3.SomeClass' once tuples, functions, units of measure and/or provided types are erased.
 + neg23.fs(28,21,28,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure3.SomeClass'.
diff between [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.bsl] and [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.err]
line 12
 - neg23.fs(26,21,26,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure3.SomeClass' once tuples, functions, units of measure and/or provided types are erased.
 + neg23.fs(26,21,26,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure3.SomeClass'.
"; neg23.vserr neg23.bsl differ; "diff between [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.bsl] and [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.vserr]
line 2
 - neg23.fs(9,21,9,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure1.SomeClass' once tuples, functions, units of measure and/or provided types are erased.
 + neg23.fs(9,21,9,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure1.SomeClass'.
diff between [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.bsl] and [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.vserr]
line 4
 - neg23.fs(7,21,7,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure1.SomeClass' once tuples, functions, units of measure and/or provided types are erased.
 + neg23.fs(7,21,7,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure1.SomeClass'.
diff between [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.bsl] and [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.vserr]
line 6
 - neg23.fs(19,21,19,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure2.SomeClass' once tuples, functions, units of measure and/or provided types are erased.
 + neg23.fs(19,21,19,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure2.SomeClass'.
diff between [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.bsl] and [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.vserr]
line 8
 - neg23.fs(17,21,17,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure2.SomeClass' once tuples, functions, units of measure and/or provided types are erased.
 + neg23.fs(17,21,17,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure2.SomeClass'.
diff between [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.bsl] and [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.vserr]
line 10
 - neg23.fs(28,21,28,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure3.SomeClass' once tuples, functions, units of measure and/or provided types are erased.
 + neg23.fs(28,21,28,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure3.SomeClass'.
diff between [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.bsl] and [D:\j\workspace\release_ci_pa---866fd2c3\tests\fsharp\typecheck\sigs\neg23.vserr]
line 12
 - neg23.fs(26,21,26,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure3.SomeClass' once tuples, functions, units of measure and/or provided types are erased.
 + neg23.fs(26,21,26,24): typecheck error FS0438: Duplicate method. The method 'Foo' has the same name and signature as another method in type 'DuplicateOverloadUpToErasure3.SomeClass'.
"
   at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1379.Invoke(String message) in D:\j\workspace\release_ci_pa---866fd2c3\src\fsharp\FSharp.Core\printf.fs:line 1379

@dsyme
Copy link
Contributor Author

dsyme commented Jul 2, 2017

@dotnet-bot test Windows_NT Release_ci_part1 Build please

@dsyme
Copy link
Contributor Author

dsyme commented Jul 6, 2017

This is ready

@dsyme
Copy link
Contributor Author

dsyme commented Dec 8, 2017

A very belated RFC for this breaking change is at https://github.com/fsharp/fslang-design/blob/master/FSharp-4.1b/FS-1046-consistent-tuple-types.md

@cartermp
Copy link
Contributor

cartermp commented Dec 8, 2017

Thanks!

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