<commit_before>class OuterTypeArgs() {
	class Foo<T>() given T satisfies Object {
		shared default class Bar<S>() given S satisfies Object {
			Bar<S> b0 = Bar<S>();
			@error Bar<S> b1 = Foo<Integer>().Bar<S>();
			Bar<S> b2 = Foo<T>().Bar<S>();
			shared default Bar<S> get() {
				return this;
			}
			shared T getT() {
				throw;
			}
			shared class Qux<R>() {
				shared Bar<S> bar {
					return outer;
				}
				shared Entry<T,S> entry(T t, S s) {
					return t->s;
				}
			}
			void method() {
				class Inner() extends Qux<String>() {}
				Foo<T>.Bar<S>.Qux<String> good = Inner();
				Bar<S>.Qux<String> ok = Inner();
				Qux<String> stillok = Inner();
				@error Foo<String>.Bar<S>.Qux<String> bad = Inner();
				@error Foo<T>.Bar<Integer>.Qux<String> alsobad = Inner();
				Entry<T,S> entry(T t, S s) {
					return Inner().entry(t,s);
				}
			}
		}
	}
	class Baz<F>() extends Foo<F>() given F satisfies Object {}
	class Fum<T>() extends Foo<T>() given T satisfies Object {
		shared actual class Bar<S>() extends super.Bar<S>() 
		        given S satisfies Object {
			shared actual Bar<S> get() {
				return this;
			}
		}
	}
	Baz<String>.Bar<Integer> foobar = Baz<String>().Bar<Integer>();
	@type:"OuterTypeArgs.Foo<String>.Bar<Integer>" value fbg = foobar.get();
	@type:"String" value fbgt = foobar.getT();
	Baz<Float>.Bar<String>.Qux<Object> foobarqux = Baz<Float>().Bar<String>().Qux<Object>();
	@type:"OuterTypeArgs.Foo<Float>.Bar<String>" value fbqg = foobarqux.bar;
	@type:"Entry<Float,String>" foobarqux.entry(1.0, "hello");

	Fum<String>.Bar<Integer> fumbar = Fum<String>().Bar<Integer>();
	@type:"OuterTypeArgs.Fum<String>.Bar<Integer>" value fmbg = fumbar.get();
	Fum<String>.Bar<Integer>.Qux<Integer> fumbarqux = Fum<String>().Bar<Integer>().Qux<Integer>();
	@type:"OuterTypeArgs.Foo<String>.Bar<Integer>" value fmbqg = fumbarqux.bar;
	@type:"Entry<String,Integer>" fumbarqux.entry("given", 30);
	
	Foo<String>.Bar<Integer> fb1 = fmbg;
	Foo<String>.Bar<Integer> fb2 = fbg; 
	Fum<String>.Bar<Integer> fb3 = fmbg;
	@error Fum<String>.Bar<Integer> fb4 = fbg; 
	Baz<String>.Bar<Integer> fb5 = fmbg;
	Baz<String>.Bar<Integer> fb6 = fbg;
	
	Baz<Object>.Bar<String> bazbarobj = Baz<Object>().Bar<String>();
	@error Baz<Integer>.Bar<String> bazbarnat = bazbarobj;
	
	class Outer<out T>(T t) {
		shared class Inner<out S>(S s) {
			shared Outer<T>.Inner<S> bar() { return this; }
		}
	}
	
	@type:"OuterTypeArgs.Outer<String>.Inner<String>" Outer("hello").Inner("world");
	@type:"OuterTypeArgs.Outer<String>.Inner<String>" Outer("hello").Inner("world").bar();
	Outer<Object>.Inner<String> oiobj = Outer("hello").Inner("world");
	Outer<String>.Inner<Object> oiobj2 = Outer("hello").Inner("world");
	@error Outer<String>.Inner<String> oistr = oiobj;
	@error Outer<Integer>.Inner<String> oinat = Outer("hello").Inner("world");

	class Consumer<in T>(T t) {
		shared class Inner<out S>(S s) {
			shared S foo(T t) { return s; }
		}
	}
	
	@type:"OuterTypeArgs.Consumer<String>.Inner<String>" Consumer("hello").Inner("world");
	@type:"String" Consumer("hello").Inner("world").foo("hello");
	Consumer<Nothing>.Inner<String> ciobj = Consumer("hello").Inner("world");
	Consumer<String>.Inner<Object> ciobj2 = Consumer("hello").Inner("world");
	@error Consumer<String>.Inner<String> cistr = ciobj;
	@error Consumer<Integer>.Inner<String> cinat = Consumer("hello").Inner("world");
	
	class Contains<out T>() {
	    shared default class Contained() {}
	}
	class Extends1() extends Contains<String>() {}
    class Extends2() extends Contains<Object>() {}
    class Refines() extends Extends2() {
        shared actual class Contained() 
            extends super.Contained() {}
    }
    @error Refines.Contained rc = Extends1().Contained(); 
    Extends2.Contained ec = Extends1().Contained(); 
    @error Extends1.Contained eco = Extends2().Contained(); 

}

<commit_msg>test for #884<commit_after>class OuterTypeArgs() {
	class Foo<T>() given T satisfies Object {
		shared default class Bar<S>() given S satisfies Object {
			Bar<S> b0 = Bar<S>();
			@error Bar<S> b1 = Foo<Integer>().Bar<S>();
			Bar<S> b2 = Foo<T>().Bar<S>();
			shared default Bar<S> get() {
				return this;
			}
			shared T getT() {
				throw;
			}
			shared class Qux<R>() {
				shared Bar<S> bar {
					return outer;
				}
				shared Entry<T,S> entry(T t, S s) {
					return t->s;
				}
			}
			void method() {
				class Inner() extends Qux<String>() {}
				Foo<T>.Bar<S>.Qux<String> good = Inner();
				Bar<S>.Qux<String> ok = Inner();
				Qux<String> stillok = Inner();
				@error Foo<String>.Bar<S>.Qux<String> bad = Inner();
				@error Foo<T>.Bar<Integer>.Qux<String> alsobad = Inner();
				Entry<T,S> entry(T t, S s) {
					return Inner().entry(t,s);
				}
			}
		}
	}
	class Baz<F>() extends Foo<F>() given F satisfies Object {}
	class Fum<T>() extends Foo<T>() given T satisfies Object {
		shared actual class Bar<S>() extends super.Bar<S>() 
		        given S satisfies Object {
			shared actual Bar<S> get() {
				return this;
			}
		}
	}
	Baz<String>.Bar<Integer> foobar = Baz<String>().Bar<Integer>();
	@type:"OuterTypeArgs.Foo<String>.Bar<Integer>" value fbg = foobar.get();
	@type:"String" value fbgt = foobar.getT();
	Baz<Float>.Bar<String>.Qux<Object> foobarqux = Baz<Float>().Bar<String>().Qux<Object>();
	@type:"OuterTypeArgs.Foo<Float>.Bar<String>" value fbqg = foobarqux.bar;
	@type:"Entry<Float,String>" foobarqux.entry(1.0, "hello");

	Fum<String>.Bar<Integer> fumbar = Fum<String>().Bar<Integer>();
	@type:"OuterTypeArgs.Fum<String>.Bar<Integer>" value fmbg = fumbar.get();
	Fum<String>.Bar<Integer>.Qux<Integer> fumbarqux = Fum<String>().Bar<Integer>().Qux<Integer>();
	@type:"OuterTypeArgs.Foo<String>.Bar<Integer>" value fmbqg = fumbarqux.bar;
	@type:"Entry<String,Integer>" fumbarqux.entry("given", 30);
	
	Foo<String>.Bar<Integer> fb1 = fmbg;
	Foo<String>.Bar<Integer> fb2 = fbg; 
	Fum<String>.Bar<Integer> fb3 = fmbg;
	@error Fum<String>.Bar<Integer> fb4 = fbg; 
	Baz<String>.Bar<Integer> fb5 = fmbg;
	Baz<String>.Bar<Integer> fb6 = fbg;
	
	Baz<Object>.Bar<String> bazbarobj = Baz<Object>().Bar<String>();
	@error Baz<Integer>.Bar<String> bazbarnat = bazbarobj;
	
	class Outer<out T>(T t) {
		shared class Inner<out S>(S s) {
			shared Outer<T>.Inner<S> bar() { return this; }
		}
	}
	
	@type:"OuterTypeArgs.Outer<String>.Inner<String>" Outer("hello").Inner("world");
	@type:"OuterTypeArgs.Outer<String>.Inner<String>" Outer("hello").Inner("world").bar();
	Outer<Object>.Inner<String> oiobj = Outer("hello").Inner("world");
	Outer<String>.Inner<Object> oiobj2 = Outer("hello").Inner("world");
	@error Outer<String>.Inner<String> oistr = oiobj;
	@error Outer<Integer>.Inner<String> oinat = Outer("hello").Inner("world");

	class Consumer<in T>(T t) {
		shared class Inner<out S>(S s) {
			shared S foo(T t) { return s; }
		}
	}
	
	@type:"OuterTypeArgs.Consumer<String>.Inner<String>" Consumer("hello").Inner("world");
	@type:"String" Consumer("hello").Inner("world").foo("hello");
	Consumer<Nothing>.Inner<String> ciobj = Consumer("hello").Inner("world");
	Consumer<String>.Inner<Object> ciobj2 = Consumer("hello").Inner("world");
	@error Consumer<String>.Inner<String> cistr = ciobj;
	@error Consumer<Integer>.Inner<String> cinat = Consumer("hello").Inner("world");
	
	class Contains<out T>() {
	    shared default class Contained() {}
	}
	class Extends1() extends Contains<String>() {}
    class Extends2() extends Contains<Object>() {}
    class Refines() extends Extends2() {
        shared actual class Contained() 
            extends super.Contained() {}
    }
    @error Refines.Contained rc = Extends1().Contained(); 
    Extends2.Contained ec = Extends1().Contained(); 
    @error Extends1.Contained eco = Extends2().Contained(); 

}

void qualifyingTypeParameters() {
    class X() {}
    class Y() extends X() {
        shared String hello = "hello";
    }
    
    class Sup() {
        shared default class XX() => X();
    }
    
    class Sub() extends Sup() {
        shared actual class XX() => Y();
    }
    
    @error S.XX fn<S>(S s) 
            given S satisfies Sup 
            => s.XX();
    
    void test() {
        @type:"Sup.XX" value supXX = fn(Sup());  //inferred type Sup.XX
        //@type:"Sup.XX" value subXX = fn(Sub());  //inferred type Sub.XX
        @error print(subXX.hello);  //error!
        @error Sub.XX err = subXX;  //error!
    }
}
{'fraction_non_alphanumeric': 0.1905102527420124, 'fraction_numerical': 0.005841678588459704, 'mean_word_length': 4.05666063893912, 'pattern_counts': {'":': 0, '<': 232, '<?xml version=': 0, '>': 237, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7134549', 'n_tokens_mistral': 3342, 'n_tokens_neox': 3007, 'n_words': 621}