Comments (4)
It could likely be added as an additional MethodError hint with register_error_hint
(or it could be a method definition like setindex!(T::Type, val, inds...) = error("Cannot assign a value to $T directly. Use $T() ...")
instead, but the former seems probably preferable?)
from julia.
Would something like this work? - ERROR: Cannot assign value to 'Dict' type directly. Use 'Dict()' to create an instance before assignment.
from julia.
looks great! (although obviously this shouldn't be specifically for Dict but whatever the type name happens to be)
from julia.
Thanks! How far should it go? ERROR: Cannot assign value to '<TypeName>' directly. Initialize with '<TypeName>()' before assignment.
seems generic enough. Also: Where in the source code is this error actually being triggered? I assume It's multiple methods forming the final string, but where would I usually start at?
Cheers
from julia.
Related Issues (20)
- Fuzzy search in MethodError for incorrect keyword arguments
- The AllocOptPass is potentially slow (and runs too often) in some cases HOT 3
- Huge virtual memory usage on Windows HOT 5
- Lacking document of `:` on docs.julialang.org
- `Base.MainInclude` regressions in v1.11, `eval` and `include` HOT 1
- Broken linkerscript, julia fails to link with modern lld versions HOT 2
- Documentation bug: `MainInclude`
- Confusing error when defining a method within nested testsets
- [FEATURE] Using Right Arrow Key to Auto Complete Virtual Text?
- should matrix-vector mul! also protect against aliasing? HOT 1
- code reports an error to line 0 HOT 5
- Average of Dates HOT 2
- safety consideration for operations with incompletely initialized types HOT 2
- Dimension check too restrictive in copytrito! and lacpy!
- LLVMPtr's address space annotation is lost with opaque pointers
- Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ffad71a9977 -- gc_setmark_pool_ HOT 3
- confusing error thrown by `display` HOT 1
- Make `ScopedValues.get` a method of `Base.get` HOT 6
- Julia without libstdc++
- `--threads` option seems to now result in segfault in `jl_init_thread_heap` (`julia/src/gc.c:3992`) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from julia.