We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb4125e commit 1f15024Copy full SHA for 1f15024
src/fileio.jl
@@ -4,11 +4,11 @@
4
5
const TextFile = Union{File{format"TXT"}, File{format"SHA256"}}
6
7
-function loadfile(T, file::File)
8
- T(load(file)) # Fallback to FileIO
+function loadfile(::Type{T}, file::File) where T
+ T(load(file))::T # Fallback to FileIO
9
end
10
11
-function loadfile(T, file::TextFile)
+function loadfile(::Type{T}, file::TextFile) where T # specialize on T only to prevent ambiguity
12
replace(read(file.filename, String), "\r"=>"") # ignore CRLF/LF difference
13
14
0 commit comments