Comments (4)
Doing f := IFoo( SFoo{} )
for example will avoid the problem, by creating a SFoo{}
instance, and converting it to an interface value.
from v.
That's because interfaces in V aren't "real" objects. They are contracts that structs can fulfill.
from v.
The problem is that there is no suitable default value for the interface.
from v.
Thanks to you for the explanation. The error message did not explain to me why the error occurred. Maybe a more detailed error message in the next versions. I'm loving this language. Very simple and powerful. Thank you again.
from v.
Related Issues (20)
- Show where bad union code is located HOT 2
- if ternary: failing to compile HOT 1
- vfmt removes selective import of interface when used only in implements clause HOT 3
- cgen error for `for mut ccc in aaa { match ccc {` where `aaa` is `[]string{}`
- tcc compiler not detected without path HOT 4
- random big.Integer function HOT 3
- Support KDL HOT 3
- Unknown type for json.decode with nested generics
- Allow same enum value HOT 2
- Running `v fmt -w gemv_test.v` formats a file in an oscillating manner, when run several times, without stabilisation.
- v template small bug something.${name}, will not work (because of . in front)
- Compilation fails under Illumos / OmniOS r151050
- What happens if you use pointer access and transformation to access memory when testing multiple structs and interfaces related to each other?
- Invalid clobber register xmm0 error with tcc on OpenBSD
- Default compiler cc not detected during compilation HOT 5
- Self tests failed with Clang and prod flag
- Wrapping a generic in a struct causes builder error when converting the generic to an array generic
- Error when using thirdparty/zip/miniz.h on OpenBSD with tcc
- json: not parsing embedded struct HOT 2
- C error: function pointer expected HOT 7
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 v.