Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error when using Maps #2

Open
thomsong opened this issue Oct 24, 2023 · 2 comments
Open

Getting error when using Maps #2

thomsong opened this issue Oct 24, 2023 · 2 comments

Comments

@thomsong
Copy link

thomsong commented Oct 24, 2023

I'm getting the following error when trying to use a Map

panic: interface conversion: interface {} is nil, not *ast.ClassType

go run . run -f Test.cls -a "Test#testMap"

public class Test {
    public static void testMap() {
        Map<String,String> info = new Map<String,String>();
        info.put('age', '5');
        info.put('name', 'Doug');
        System.debug(info.keySet());
    }
}
@thomsong
Copy link
Author

thomsong commented Oct 24, 2023

Additional Error Info

panic: interface conversion: interface {} is nil, not *ast.ClassType

goroutine 1 [running]:
github.com/tzmfreedom/land/compiler.(*TypeChecker).VisitMethodInvocation(0x14000718ba0, 0x14000411340)
    ./land-master/compiler/type_checker.go:322 +0x7d4
github.com/tzmfreedom/land/ast.(*MethodInvocation).Accept(0x10?, {0x1054c60f0?, 0x14000718ba0?})
    ./land-master/ast/node.go:821 +0x30
github.com/tzmfreedom/land/compiler.(*TypeChecker).VisitBlock.func1()
    ./land-master/compiler/type_checker.go:778 +0x9c
github.com/tzmfreedom/land/compiler.(*TypeChecker).NewEnv(0x14000718ba0, 0x1400082cf80)
    ./land-master/compiler/type_checker.go:904 +0xe4
github.com/tzmfreedom/land/compiler.(*TypeChecker).VisitBlock(0x1053cb200?, 0x140008573b0?)
    ./land-master/compiler/type_checker.go:776 +0x58
github.com/tzmfreedom/land/ast.(*Block).Accept(...)
    ./land-master/ast/node.go:1084
github.com/tzmfreedom/land/compiler.(*TypeChecker).VisitMethod(0x14000718ba0, 0x1400031f810)
    ./land-master/compiler/type_checker.go:879 +0x344
github.com/tzmfreedom/land/compiler.(*TypeChecker).VisitClassType(0x14000718ba0, 0x140003d1440)
    ./land-master/compiler/type_checker.go:71 +0xa6c
main.semanticAnalysis(0x140003d1440?)
    ./land-master/commands.go:497 +0x34c
main.buildAllFile({0x14000437b30, 0x1, 0x1052344c7?})
    ./land-master/commands.go:761 +0x2a4
main.glob..func11(0x14000328840)
    ./land-master/commands.go:341 +0x74
gopkg.in/urfave/cli%2ev1.HandleAction({0x1053a9300?, 0x10549fab8?}, 0x3?)
    ./go/pkg/mod/gopkg.in/urfave/[email protected]/app.go:490 +0x6c
gopkg.in/urfave/cli%2ev1.Command.Run({{0x105233eb7, 0x3}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, 0x0}, {0x0, ...}, ...}, ...)
    ./go/pkg/mod/gopkg.in/urfave/[email protected]/command.go:210 +0x68c
gopkg.in/urfave/cli%2ev1.(*App).Run(0x14000103520, {0x14000134120, 0x6, 0x6})
    ./go/pkg/mod/gopkg.in/urfave/[email protected]/app.go:255 +0x758
main.main()
    ./land-master/land.go:37 +0x510
exit status 2

@tzmfreedom
Copy link
Owner

tzmfreedom commented Nov 18, 2024

@thomsong Thank you for reporting issue !
I fixed in #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants