Skip to content

Commit

Permalink
Fix 32 - add general check for escaping typars to check phase
Browse files Browse the repository at this point in the history
This (partly) addresses the class of conditions like #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 #32 the check is actually the
best way to detect the escape condition.

fixes #32
closes #442

commit 5d4d818
Merge: 3c3708f 0b88185
Author: Don Syme <[email protected]>
Date:   Tue May 19 14:33:37 2015 +0100

    merge fsharp4

commit 3c3708f
Author: Don Syme <[email protected]>
Date:   Tue May 19 14:31:06 2015 +0100

    normalzie equi-recursive

commit 220131b
Author: Don Syme <[email protected]>
Date:   Tue May 12 15:32:07 2015 +0100

    update tests, change warning to error

commit 53153b8
Author: Don Syme <[email protected]>
Date:   Tue May 12 15:01:44 2015 +0100

    add general check for escaping typars to check phase
  • Loading branch information
dsyme authored and latkin committed Aug 6, 2015
1 parent c40ec84 commit 88e246b
Show file tree
Hide file tree
Showing 6 changed files with 165 additions and 101 deletions.
2 changes: 2 additions & 0 deletions src/fsharp/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1342,3 +1342,5 @@ estApplyStaticArgumentsForMethodNotImplemented,"A type provider implemented GetS
3184,ppparsIncompleteExpression,"Incomplete preprocessor expression"
3185,ppparsMissingToken,"Missing token '%s' in preprocessor expression"
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."
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."
3188,checkNotSufficientlyGenericBecauseOfScopeAnon,"Type inference caused an inference type variable to escape its scope. Consider adding type annotations to make your code less generic."
Loading

0 comments on commit 88e246b

Please sign in to comment.