Skip to content

Commit 88e246b

Browse files
dsymelatkin
authored andcommitted
Fix 32 - add general check for escaping typars to check phase
This (partly) addresses the class of conditions like dotnet/fsharp#32 which give "undefined type variable" internal errors by adding an earlier check to check.fs which gives a user-visible error in this case. These conditions can in some cases indicate problems with type inference, though in the case of dotnet/fsharp#32 the check is actually the best way to detect the escape condition. fixes dotnet/fsharp#32 closes dotnet/fsharp#442 commit 5d4d818af94242b8f0594450721378762e6fe876 Merge: 3c3708f 0b88185 Author: Don Syme <donsyme@fastmail.fm> Date: Tue May 19 14:33:37 2015 +0100 merge fsharp4 commit 3c3708fda6d0c16c45f68caed09a05a38c41f746 Author: Don Syme <donsyme@fastmail.fm> Date: Tue May 19 14:31:06 2015 +0100 normalzie equi-recursive commit 220131b3c88e149f3e6890da46de31d748233b54 Author: Don Syme <donsyme@fastmail.fm> Date: Tue May 12 15:32:07 2015 +0100 update tests, change warning to error commit 53153b8b1d60a50eb91f43b1f78bfda99d3a4a87 Author: Don Syme <donsyme@fastmail.fm> Date: Tue May 12 15:01:44 2015 +0100 add general check for escaping typars to check phase
1 parent c40ec84 commit 88e246b

File tree

6 files changed

+165
-101
lines changed

6 files changed

+165
-101
lines changed

src/fsharp/FSComp.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,3 +1342,5 @@ estApplyStaticArgumentsForMethodNotImplemented,"A type provider implemented GetS
13421342
3184,ppparsIncompleteExpression,"Incomplete preprocessor expression"
13431343
3185,ppparsMissingToken,"Missing token '%s' in preprocessor expression"
13441344
3186,pickleMissingDefinition,"An error occurred while reading the F# metadata node at position %d in table '%s' of assembly '%s'. The node had no matching declaration. Please report this warning. You may need to recompile the F# assembly you are using."
1345+
3187,checkNotSufficientlyGenericBecauseOfScope,"Type inference caused the type variable %s to escape its scope. Consider adding an explicit type parameter declaration or adjusting your code to be less generic."
1346+
3188,checkNotSufficientlyGenericBecauseOfScopeAnon,"Type inference caused an inference type variable to escape its scope. Consider adding type annotations to make your code less generic."

0 commit comments

Comments
 (0)