Comments (4)
Thank for spotting this :)
I'll investigate this bug
from gomacro.
I've just rechecked this issue, and it seems to be working now (using Go toolchain <= 1.19, see issue #146).
Can you confirm?
from gomacro.
I re-checked after (hopefully) fixing issue #146, and now import "github.com/looplab/fsm"
fails with:
gomacro> import "github.com/looplab/fsm"
// debug: running "go get github.com/looplab/fsm" ...
go: added github.com/looplab/fsm v1.0.1
// debug: running "go mod tidy" ...
// debug: compiling plugin "/home/max/go/src/gomacro.imports/gomacro_pid_28645/import_1" ...
Converter.Type(): unsupported types.Type: *types.TypeParam
This is because gomacro does not yet know about go/types.TypeParam
which represents a type parameter for a Go generic.
I'll add support for them as soon as I have time.
from gomacro.
Commit 68a1200 skips generics when importing third-party packages,
because importing generics is not yet supported.
Now import "github.com/looplab/fsm"
works:
gomacro> import "github.com/looplab/fsm"
// debug: running "go get github.com/looplab/fsm" ...
go: added github.com/looplab/fsm v1.0.1
// debug: running "go mod tidy" ...
// debug: compiling plugin "/home/max/go/src/gomacro.imports/gomacro_pid_19060/import_1" ...
// warning: skipping import of func sync.OnceValue[T any](f func() T) func() T: importing generic functions or types is not supported yet
// warning: skipping import of func sync.OnceValues[T1, T2 any](f func() (T1, T2)) func() (T1, T2): importing generic functions or types is not supported yet
gomacro> :env fsm
// ----- "github.com/looplab/fsm" binds -----
FlowChart = flowChart // fsm.MermaidDiagramType
GRAPHVIZ = graphviz // fsm.VisualizeType
MERMAID = mermaid // fsm.VisualizeType
MermaidFlowChart = mermaid-flow-chart // fsm.VisualizeType
MermaidStateDiagram = mermaid-state-diagram // fsm.VisualizeType
NewFSM = 0x7f8eb4375380 // func(string, []fsm.EventDesc, map[string]fsm.Callback) *fsm.FSM
StateDiagram = stateDiagram // fsm.MermaidDiagramType
Visualize = 0x7f8eb43782e0 // func(*fsm.FSM) string
VisualizeForMermaidWithGraphType = 0x7f8eb43788c0 // func(*fsm.FSM, fsm.MermaidDiagramType) (string, error)
VisualizeWithType = 0x7f8eb4379300 // func(*fsm.FSM, fsm.VisualizeType) (string, error)
// ----- "github.com/looplab/fsm" types -----
AsyncError = fsm.AsyncError // struct
Callback = fsm.Callback // func
Callbacks = fsm.Callbacks // map
CanceledError = fsm.CanceledError // struct
Event = fsm.Event // struct
EventDesc = fsm.EventDesc // struct
Events = fsm.Events // slice
FSM = fsm.FSM // struct
InTransitionError = fsm.InTransitionError // struct
InternalError = fsm.InternalError // struct
InvalidEventError = fsm.InvalidEventError // struct
MermaidDiagramType = fsm.MermaidDiagramType // string
NoTransitionError = fsm.NoTransitionError // struct
NotInTransitionError = fsm.NotInTransitionError // struct
UnknownEventError = fsm.UnknownEventError // struct
VisualizeType = fsm.VisualizeType // string
from gomacro.
Related Issues (20)
- I would like a full working example how to inject my application context(types and functions) in the REPL HOT 9
- Extract struct with methods from script to compiled code HOT 2
- Proxy can mix the called method of the imported structure HOT 3
- integrate with https://github.com/go-rod/rod HOT 2
- I'm unable to compile code importing gomacro on Mac OS m1 pro HOT 7
- Is there a way to Eval a folder HOT 5
- recursive type error cases: call of reflect.Value.Interface on zero Value HOT 6
- Different compilation behaviour from native go HOT 2
- undefined: pkgpath HOT 3
- Cannot convert struct to interface if it has an embedded struct with a method HOT 4
- Cannot import third party packages on Linux (not even the ones in the README) HOT 2
- Third-party imported type method is not callable from fast.Interp.Eval [gomacro repl works] HOT 4
- Idea for making adding third party packages to Gomacro easier when plugins aren't available HOT 3
- recursive type error cases: call of reflect.Value.Interface on zero Value
- can not import 3rd party packages HOT 13
- package <package> exports zero constants, functions, types, and variables HOT 3
- Caching of interp.Eval1 results HOT 13
- Way to disable go get import and enforce to use only defined import list HOT 3
- An error will be reported when using third-party packages on Windows HOT 2
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 gomacro.