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

Commit38db642

Browse files
committed
Change internal error to regular error when #load'ing files with wrong extension
fixesdotnet#269
1 parent220c17d commit38db642

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed

‎src/fsharp/FSComp.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ buildCouldNotReadVersionInfoFromMscorlib,"Could not read version from mscorlib.d
3838
221,buildImplicitModuleIsNotLegalIdentifier,"The declarations in this file will be placed in an implicit module '%s' based on the file name '%s'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file."
3939
222,buildMultiFileRequiresNamespaceOrModule,"Files in libraries or multiple-file applications must begin with a namespace or module declaration, e.g. 'namespace SomeNamespace.SubNamespace' or 'module SomeNamespace.SomeModule'. Only the last source file of an application may omit such a declaration."
4040
223,buildMultipleToplevelModules,"This file contains multiple declarations of the form 'module SomeNamespace.SomeModule'. Only one declaration of this form is permitted in a file. Change your file to use an initial namespace declaration and/or use 'module ModuleName = ...' to define your modules."
41-
buildUnknownFileSuffix,"ParseInput: unknown file suffix for '%s'"
4241
224,buildOptionRequiresParameter,"Option requires parameter: %s"
4342
225,buildCouldNotFindSourceFile,"Source file '%s' could not be found"
4443
226,buildInvalidSourceFileExtension,"The file extension of '%s' is not recognized. Source files must have extension .fs, .fsi, .fsx, .fsscript, .ml or .mli."

‎src/fsharp/build.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3177,7 +3177,7 @@ let ParseInput (lexer,errorLogger:ErrorLogger,lexbuf:UnicodeLexing.Lexbuf,defaul
31773177
letintfs= Parser.signatureFile lexer lexbuf
31783178
PostParseModuleSpecs(defaultNamespace,filename,isLastCompiland,intfs)
31793179
else
3180-
errorLogger.Error(InternalError(FSComp.SR.buildUnknownFileSuffix(filename),Range.rangeStartup))
3180+
errorLogger.Error(Error(FSComp.SR.buildInvalidSourceFileExtension(filename),Range.rangeStartup))
31813181
filteringErrorLogger.ScopedPragmas<- GetScopedPragmasForInput input
31823182
input
31833183
finally
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#load"dummy.txt"
2+
3+
()
4+
5+
//<Expects status="error" id="FS0226">The file extension of '.+\\dummy\.txt' is not recognized\. Source files must have extension \.fs, \.fsi, \.fsx, \.fsscript, \.ml or \.mli\.$</Expects>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
()

‎tests/fsharpqa/Source/InteractiveSession/Misc/env.lst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ ReqENUSOURCE=E_InterfaceCrossConstrained02.fsx COMPILE_ONLY=1 FSIMODE=PIPE SC
2323
SOURCE=E_type_id_equal_pipe.fsx COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS="--nologo"# E_type_id_equal_pipe.fsx
2424
SOURCE=E_module_mutable_id_equal.fsx COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS="--nologo"# E_module_mutable_id_equal.fsx
2525
SOURCE=E_let_id_equal_let_id_equal_n.fsx COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS="--nologo"# E_let_id_equal_let_id_equal_n.fsx
26+
SOURCE=E_load_badextension.fsx COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS="--nologo" # E_load_badextension.fsx
2627

2728
SOURCE=EmptyList.fsx COMPILE_ONLY=1 FSIMODE=PIPE SCFLAGS="--nologo"# EmptyList.fsx
2829

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp