Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8de3e85

Browse files
dsymelatkin
authored andcommitted
1 parent438eae2 commit8de3e85

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

‎src/fsharp/tc.fs‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4538,7 +4538,14 @@ and TcTypeOrMeasureAndRecover optKind cenv newOk checkCxs occ env tpenv ty =
45384538
try TcTypeOrMeasure optKind cenv newOk checkCxs occ env tpenv ty
45394539
with e ->
45404540
errorRecovery e ty.Range
4541-
(if newOk <> NoNewTypars then NewErrorType () else cenv.g.obj_ty),tpenv
4541+
let rty =
4542+
match optKind, newOk with
4543+
| Some TyparKind.Measure, NoNewTypars -> TType_measure MeasureOne
4544+
| Some TyparKind.Measure, _ -> TType_measure (NewErrorMeasure ())
4545+
| _, NoNewTypars -> cenv.g.obj_ty
4546+
| _ -> NewErrorType ()
4547+
rty,tpenv
4548+
45424549

45434550
and TcTypeAndRecover cenv newOk checkCxs occ env tpenv ty =
45444551
TcTypeOrMeasureAndRecover (Some TyparKind.Type) cenv newOk checkCxs occ env tpenv ty
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11

22
neg90.fs(4,9,4,12): typecheck error FS0001: A generic construct requires that the type 'Recd' have a public default constructor
3+
4+
neg90.fs(7,22,7,25): typecheck error FS0039: The type 'foo' isnot defined
5+
6+
neg90.fs(7,22,7,25): typecheck error FS0039: The type 'foo' isnot defined
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
moduleTest
22
letfoo<'awhen'a:(new: unit-> 'a)>()=new 'a()
33
typeRecd={f:int}
4-
let_= foo<Recd>()
4+
let_= foo<Recd>()
5+
6+
// See https://github.com/Microsoft/visualfsharp/issues/38
7+
type[<Measure>]N= foo// foo is undefined
8+
typeM2= float<N>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp