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

Julia Type Hint #160

Open
1 of 3 tasks
zxj5470 opened this issue Apr 15, 2018 · 8 comments
Open
1 of 3 tasks

Julia Type Hint #160

zxj5470 opened this issue Apr 15, 2018 · 8 comments
Assignees
Labels
code analysis New analysis or bugs index stub new feature Something excited
Milestone

Comments

@zxj5470
Copy link
Collaborator

zxj5470 commented Apr 15, 2018

Just like Kotlin type Hint or JavaX-Var-Hint

  • Literal Type Hint
  • Array Type Hint
  • Reference Type Hint
@zxj5470 zxj5470 added the new feature Something excited label Apr 15, 2018
@zxj5470 zxj5470 added this to the 0.4.0 milestone Apr 15, 2018
@zxj5470 zxj5470 self-assigned this Apr 15, 2018
@ice1000
Copy link
Member

ice1000 commented Apr 15, 2018

This feature requires type inference

@ice1000 ice1000 modified the milestones: 0.4.0, 0.8.0 Apr 15, 2018
@ice1000 ice1000 added the code analysis New analysis or bugs label Apr 15, 2018
@zxj5470
Copy link
Collaborator Author

zxj5470 commented Apr 15, 2018

just needs a API to get return type from PSI

@ice1000
Copy link
Member

ice1000 commented Apr 15, 2018

The return type must be inferred

@zxj5470
Copy link
Collaborator Author

zxj5470 commented Oct 2, 2018

image

zxj5470 added a commit that referenced this issue Oct 2, 2018
@ice1000
Copy link
Member

ice1000 commented Oct 2, 2018

What's the rule of parsing version number?

julia> v""
ERROR: LoadError: ArgumentError: invalid version string:
Stacktrace:
 [1] VersionNumber(::String) at ./version.jl:111
 [2] @v_str(::LineNumberNode, ::Module, ::Any) at ./version.jl:138
in expression starting at REPL[1]:1

Can we report errors on this?

zxj5470 added a commit that referenced this issue Oct 2, 2018
@ice1000
Copy link
Member

ice1000 commented Oct 6, 2018

66666666666666666

@zxj5470
Copy link
Collaborator Author

zxj5470 commented Oct 7, 2018

add an option for versionString in Annotator to check it...

@zxj5470
Copy link
Collaborator Author

zxj5470 commented Oct 7, 2018

Do we need to transform these into Kotlin?

    function VersionNumber(major::VInt, minor::VInt, patch::VInt,
            pre::Tuple{Vararg{Union{UInt64,String}}},
            bld::Tuple{Vararg{Union{UInt64,String}}})
        major >= 0 || throw(ArgumentError("invalid negative major version: $major"))
        minor >= 0 || throw(ArgumentError("invalid negative minor version: $minor"))
        patch >= 0 || throw(ArgumentError("invalid negative patch version: $patch"))
        for ident in pre
            if ident isa Integer
                ident >= 0 || throw(ArgumentError("invalid negative pre-release identifier: $ident"))
            else
                if !occursin(r"^(?:|[0-9a-z-]*[a-z-][0-9a-z-]*)$"i, ident) ||
                    isempty(ident) && !(length(pre)==1 && isempty(bld))
                    throw(ArgumentError("invalid pre-release identifier: $(repr(ident))"))
                end
            end
        end
        for ident in bld
            if ident isa Integer
                ident >= 0 || throw(ArgumentError("invalid negative build identifier: $ident"))
            else
                if !occursin(r"^(?:|[0-9a-z-]*[a-z-][0-9a-z-]*)$"i, ident) ||
                    isempty(ident) && length(bld)!=1
                    throw(ArgumentError("invalid build identifier: $(repr(ident))"))
                end
            end
        end
        new(major, minor, patch, pre, bld)
    end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code analysis New analysis or bugs index stub new feature Something excited
Projects
None yet
Development

No branches or pull requests

2 participants