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

Define type filtering through an intersection operation #10781

Merged
6 changes: 2 additions & 4 deletions src/compiler/crystal/semantic/match.cr
Expand Up @@ -46,12 +46,10 @@ module Crystal
# Any instance variables associated with the method instantiation
getter free_vars : Hash(String, TypeVar)?

getter? strict : Bool

# Def free variables, unbound (`def (X, Y) ...`)
property def_free_vars : Array(String)?

def initialize(@instantiated_type, @defining_type, @free_vars = nil, @strict = false, @def_free_vars = nil)
def initialize(@instantiated_type, @defining_type, @free_vars = nil, @def_free_vars = nil)
end

def get_free_var(name)
Expand Down Expand Up @@ -93,7 +91,7 @@ module Crystal
end

def clone
MatchContext.new(@instantiated_type, @defining_type, @free_vars.dup, @strict, @def_free_vars.dup)
MatchContext.new(@instantiated_type, @defining_type, @free_vars.dup, @def_free_vars.dup)
end
end

Expand Down