Skip to content

Commit

Permalink
Suggestions for mispelled values, namespaces and co - fixes dotnet#1909
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Dec 4, 2016
1 parent 117e5f6 commit b953a78
Show file tree
Hide file tree
Showing 23 changed files with 450 additions and 56 deletions.
156 changes: 114 additions & 42 deletions src/fsharp/NameResolution.fs

Large diffs are not rendered by default.

96 changes: 96 additions & 0 deletions tests/fsharp/typecheck/sigs/neg06.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -95,26 +95,98 @@ neg06.fs(141,10,141,18): typecheck error FS0954: This type definition involves a

neg06.fs(148,13,148,21): typecheck error FS0039: The value or constructor 'BadType1' is not defined

Maybe you want one of the following:

BadType0

BadExtensionOfSealedType

Bid

SealedType

BadSealedAbbreviatedType

neg06.fs(150,10,150,18): typecheck error FS0954: This type definition involves an immediate cyclic reference through a struct field or inheritance relation

neg06.fs(157,13,157,21): typecheck error FS0039: The value or constructor 'BadType2' is not defined

Maybe you want one of the following:

BadType0

BadExtensionOfSealedType

Bid

SealedType

BadSealedAbbreviatedType

neg06.fs(159,10,159,18): typecheck error FS0954: This type definition involves an immediate cyclic reference through a struct field or inheritance relation

neg06.fs(166,13,166,21): typecheck error FS0039: The value or constructor 'BadType3' is not defined

Maybe you want one of the following:

BadType0

BadExtensionOfSealedType

Bid

SealedType

BadSealedAbbreviatedType

neg06.fs(195,10,195,18): typecheck error FS0954: This type definition involves an immediate cyclic reference through a struct field or inheritance relation

neg06.fs(203,13,203,21): typecheck error FS0039: The value or constructor 'BadType1' is not defined

Maybe you want one of the following:

BadExtensionOfSealedType

Bid

SealedType

BadSealedAbbreviatedType

typeof

neg06.fs(205,10,205,18): typecheck error FS0954: This type definition involves an immediate cyclic reference through a struct field or inheritance relation

neg06.fs(213,13,213,21): typecheck error FS0039: The value or constructor 'BadType2' is not defined

Maybe you want one of the following:

BadExtensionOfSealedType

Bid

SealedType

BadSealedAbbreviatedType

typeof

neg06.fs(215,10,215,18): typecheck error FS0954: This type definition involves an immediate cyclic reference through a struct field or inheritance relation

neg06.fs(223,13,223,21): typecheck error FS0039: The value or constructor 'BadType3' is not defined

Maybe you want one of the following:

BadExtensionOfSealedType

Bid

SealedType

BadSealedAbbreviatedType

typeof

neg06.fs(294,10,294,12): typecheck error FS0009: Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.

neg06.fs(298,10,298,12): typecheck error FS0009: Uses of this construct may result in the generation of unverifiable .NET IL code. This warning can be disabled using '--nowarn:9' or '#nowarn "9"'.
Expand All @@ -133,10 +205,34 @@ neg06.fs(326,10,326,18): typecheck error FS0954: This type definition involves a

neg06.fs(335,13,335,21): typecheck error FS0039: The value or constructor 'BadType4' is not defined

Maybe you want one of the following:

BadBox4

BadExtensionOfSealedType

Bid

SealedType

BadSealedAbbreviatedType

neg06.fs(340,10,340,18): typecheck error FS0954: This type definition involves an immediate cyclic reference through a struct field or inheritance relation

neg06.fs(350,13,350,21): typecheck error FS0039: The value or constructor 'BadType4' is not defined

Maybe you want one of the following:

BadBox4

BadExtensionOfSealedType

Bid

SealedType

BadSealedAbbreviatedType

neg06.fs(375,9,375,10): typecheck error FS1197: The parameter 'x' was inferred to have byref type. Parameters of byref type must be given an explicit type annotation, e.g. 'x1: byref<int>'. When used, a byref parameter is implicitly dereferenced.

neg06.fs(382,13,382,19): typecheck error FS0041: A unique overload for method 'M1' could not be determined based on type information prior to this program point. A type annotation may be needed. Candidates: static member C.M1 : x:int -> int, static member C.M1 : x:string -> int
Expand Down
24 changes: 24 additions & 0 deletions tests/fsharp/typecheck/sigs/neg07.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ neg07.fs(7,10,7,29): typecheck error FS0049: Uppercase variable identifiers shou

neg07.fs(24,13,24,23): typecheck error FS0039: The value or constructor 'UnionCase1' is not defined

Maybe you want one of the following:

Sni_Consumer_Info

nan

not

UnverifiableAttribute

SNI_ConnWrapper

neg07.fs(27,11,27,21): typecheck error FS0049: Uppercase variable identifiers should not generally be used in patterns, and may indicate a misspelt pattern name.

neg07.fs(28,11,28,21): typecheck error FS0049: Uppercase variable identifiers should not generally be used in patterns, and may indicate a misspelt pattern name.
Expand All @@ -13,6 +25,18 @@ neg07.fs(28,11,28,21): typecheck error FS0026: This rule will never be matched

neg07.fs(31,18,31,28): typecheck error FS0039: The value or constructor 'UnionCase1' is not defined

Maybe you want one of the following:

Sni_Consumer_Info

nan

not

UnverifiableAttribute

SNI_ConnWrapper

neg07.fs(35,11,35,21): typecheck error FS0049: Uppercase variable identifiers should not generally be used in patterns, and may indicate a misspelt pattern name.

neg07.fs(36,11,36,21): typecheck error FS0049: Uppercase variable identifiers should not generally be used in patterns, and may indicate a misspelt pattern name.
Expand Down
24 changes: 24 additions & 0 deletions tests/fsharp/typecheck/sigs/neg16.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,32 @@ neg16.fs(85,8,85,18): typecheck error FS0039: The pattern discriminator 'FooA++'

neg16.fs(87,50,87,54): typecheck error FS0039: The value or constructor 'OneA' is not defined

Maybe you want one of the following:

None

Ok

Binder

nullArg

exn

neg16.fs(87,60,87,69): typecheck error FS0039: The value or constructor 'TwoA+' is not defined

Maybe you want one of the following:

ThisAssembly

TypeAttributes

MTConfigUtil

( |FooA++| )

box

neg16.fs(90,8,90,18): typecheck error FS0039: The pattern discriminator 'FooB++' is not defined

neg16.fs(97,15,97,16): typecheck error FS0823: The 'VolatileField' attribute may only be used on 'let' bindings in classes
Expand Down
12 changes: 12 additions & 0 deletions tests/fsharp/typecheck/sigs/neg54.bsl
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@

neg54.fs(8,25,8,30): typecheck error FS0039: The value or constructor '_arg1' is not defined

Maybe you want one of the following:

char

log10

string

array2D

or
36 changes: 36 additions & 0 deletions tests/fsharp/typecheck/sigs/neg59.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,48 @@ neg59.fs(9,13,9,17): typecheck error FS3096: 'join' must be followed by a variab

neg59.fs(9,39,9,40): typecheck error FS0039: The value or constructor 'j' is not defined

Maybe you want one of the following:

join

( ! )

( % )

( & )

( && )

neg59.fs(10,24,10,25): typecheck error FS0039: The value or constructor 'j' is not defined

Maybe you want one of the following:

join

( ! )

( % )

( & )

( && )

neg59.fs(15,13,15,22): typecheck error FS3096: 'groupJoin' must be followed by a variable name. Usage: groupJoin var in collection on (outerKey = innerKey) into group. Note that parentheses are required after 'on'.

neg59.fs(15,44,15,45): typecheck error FS0039: The value or constructor 'j' is not defined

Maybe you want one of the following:

join

joinMustUseASimplePattern

( ! )

( % )

( & )

neg59.fs(25,23,25,40): typecheck error FS3147: This 'let' definition may not be used in a query. Only simple value definitions may be used in queries.

neg59.fs(31,23,31,24): typecheck error FS3147: This 'let' definition may not be used in a query. Only simple value definitions may be used in queries.
Expand Down
36 changes: 36 additions & 0 deletions tests/fsharp/typecheck/sigs/neg61.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,36 @@ neg61.fs(22,13,22,16): typecheck error FS3145: This is not a known query operato

neg61.fs(22,13,22,16): typecheck error FS0039: The value or constructor 'zip' is not defined

Maybe you want one of the following:

skip

skipWhile

id

Bid

Map

neg61.fs(26,13,26,19): typecheck error FS3099: 'select' is used with an incorrect number of arguments. This is a custom operation in this query or computation expression. Expected 1 argument(s), but given 0.

neg61.fs(30,13,30,16): typecheck error FS3145: This is not a known query operator. Query operators are identifiers such as 'select', 'where', 'sortBy', 'thenBy', 'groupBy', 'groupValBy', 'join', 'groupJoin', 'sumBy' and 'averageBy', defined using corresponding methods on the 'QueryBuilder' type.

neg61.fs(30,13,30,16): typecheck error FS0039: The value or constructor 'zip' is not defined

Maybe you want one of the following:

skip

skipWhile

id

Bid

Map

neg61.fs(34,13,34,22): typecheck error FS3096: 'groupJoin' must be followed by a variable name. Usage: groupJoin var in collection on (outerKey = innerKey) into group. Note that parentheses are required after 'on'.

neg61.fs(34,13,34,22): typecheck error FS3167: 'groupJoin' must be followed by 'in'. Usage: groupJoin var in collection on (outerKey = innerKey) into group. Note that parentheses are required after 'on'.
Expand Down Expand Up @@ -43,6 +67,18 @@ neg61.fs(56,13,56,15): typecheck error FS3145: This is not a known query operato

neg61.fs(56,16,56,19): typecheck error FS0039: The value or constructor 'zip' is not defined

Maybe you want one of the following:

skip

skipWhile

id

Bid

Map

neg61.fs(60,13,60,21): typecheck error FS3145: This is not a known query operator. Query operators are identifiers such as 'select', 'where', 'sortBy', 'thenBy', 'groupBy', 'groupValBy', 'join', 'groupJoin', 'sumBy' and 'averageBy', defined using corresponding methods on the 'QueryBuilder' type.

neg61.fs(60,13,60,21): typecheck error FS0193: This expression is a function value, i.e. is missing arguments. Its type is ^a -> ^a.
Expand Down
24 changes: 24 additions & 0 deletions tests/fsharp/typecheck/sigs/neg90.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,32 @@ neg90.fs(4,9,4,12): typecheck error FS0001: A generic construct requires that th

neg90.fs(7,22,7,25): typecheck error FS0039: The type 'foo' is not defined

Maybe you want one of the following:

float

float32

bool

option

NoComparisonAttribute

neg90.fs(7,22,7,25): typecheck error FS0039: The type 'foo' is not defined

Maybe you want one of the following:

float

float32

bool

option

NoComparisonAttribute

neg90.fs(16,9,16,21): typecheck error FS0035: This construct is deprecated: The union type for union case 'Member' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('DU') in the name you are using.

neg90.fs(28,9,28,41): typecheck error FS0035: This construct is deprecated: The record type for the record field 'Field1' was defined with the RequireQualifiedAccessAttribute. Include the name of the record type ('Record1') in the name you are using.
12 changes: 12 additions & 0 deletions tests/fsharp/typecheck/sigs/neg94.bsl
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@

neg94.fs(6,12,6,21): typecheck error FS0039: The value or constructor 'undefined' is not defined

Maybe you want one of the following:

unativeint

infinity

round

unbox

ref
Loading

0 comments on commit b953a78

Please sign in to comment.